/**
 * TaxFlow Client Portal Styles
 * TaxDome-inspired design
 */

/* CSS Variables */
:root {
    --portal-primary: #2563eb;
    --portal-primary-dark: #1e40af;
    --portal-secondary: #64748b;
    --portal-success: #10b981;
    --portal-warning: #f59e0b;
    --portal-danger: #ef4444;
    --portal-info: #3b82f6;

    --portal-gray-50: #f9fafb;
    --portal-gray-100: #f3f4f6;
    --portal-gray-200: #e5e7eb;
    --portal-gray-300: #d1d5db;
    --portal-gray-400: #9ca3af;
    --portal-gray-500: #6b7280;
    --portal-gray-600: #4b5563;
    --portal-gray-700: #374151;
    --portal-gray-800: #1f2937;
    --portal-gray-900: #111827;

    --portal-border-radius: 8px;
    --portal-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --portal-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --portal-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --portal-header-height: 70px;
    --portal-nav-height: 50px;
}

/* Reset & Base */
.portal-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background-color: var(--portal-gray-50);
    color: var(--portal-gray-900);
    line-height: 1.6;
}

/* Header */
.portal-header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    height: var(--portal-header-height);
    box-shadow: var(--portal-shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-logo {
    height: 40px;
    width: auto;
}

.portal-brand {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.portal-header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.portal-notification-icon {
    position: relative;
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.portal-notification-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--portal-danger);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.portal-user-menu {
    position: relative;
}

.portal-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--portal-border-radius);
    transition: background-color 0.2s;
}

.portal-user-info:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.portal-welcome {
    font-size: 14px;
}

.portal-user-avatar {
    font-size: 28px;
}

.portal-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: var(--portal-shadow-lg);
    border-radius: var(--portal-border-radius);
    min-width: 200px;
    margin-top: 8px;
    display: none;
    overflow: hidden;
}

.portal-user-menu:hover .portal-user-dropdown {
    display: block;
}

.portal-user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--portal-gray-700);
    text-decoration: none;
    transition: background-color 0.2s;
}

.portal-user-dropdown .dropdown-item:hover {
    background-color: var(--portal-gray-100);
}

/* Navigation */
.portal-nav {
    background: white;
    border-bottom: 1px solid var(--portal-gray-200);
    height: var(--portal-nav-height);
    box-shadow: var(--portal-shadow-sm);
    position: sticky;
    top: var(--portal-header-height);
    z-index: 99;
}

.portal-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    gap: 8px;
}

.portal-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    color: var(--portal-gray-600);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.portal-nav-item:hover {
    color: var(--portal-primary);
    background-color: var(--portal-gray-50);
}

.portal-nav-item.active {
    color: var(--portal-primary);
    border-bottom-color: var(--portal-primary);
}

.nav-badge {
    background-color: var(--portal-danger);
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* Main Content */
.portal-main {
    min-height: calc(100vh - var(--portal-header-height) - var(--portal-nav-height) - 80px);
    padding: 32px 0;
}

.portal-main-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.portal-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Messages/Alerts */
.portal-messages {
    margin-bottom: 24px;
}

.portal-alert {
    padding: 12px 16px;
    border-radius: var(--portal-border-radius);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--portal-success);
}

.portal-alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--portal-danger);
}

.portal-alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--portal-warning);
}

.portal-alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--portal-info);
}

/* Footer */
.portal-footer {
    background: white;
    border-top: 1px solid var(--portal-gray-200);
    padding: 24px 0;
    margin-top: 48px;
}

.portal-footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--portal-gray-600);
    font-size: 14px;
}

.portal-footer-links {
    display: flex;
    gap: 24px;
}

.portal-footer-links a {
    color: var(--portal-gray-600);
    text-decoration: none;
    transition: color 0.2s;
}

.portal-footer-links a:hover {
    color: var(--portal-primary);
}

/* Cards */
.portal-card {
    background: white;
    border-radius: var(--portal-border-radius);
    box-shadow: var(--portal-shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.portal-card-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--portal-gray-900);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-card-body {
    color: var(--portal-gray-700);
}

/* Buttons */
.portal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--portal-border-radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.portal-btn-primary {
    background-color: var(--portal-primary);
    color: white;
}

.portal-btn-primary:hover {
    background-color: var(--portal-primary-dark);
}

.portal-btn-secondary {
    background-color: var(--portal-gray-200);
    color: var(--portal-gray-700);
}

.portal-btn-secondary:hover {
    background-color: var(--portal-gray-300);
}

.portal-btn-success {
    background-color: var(--portal-success);
    color: white;
}

.portal-btn-danger {
    background-color: var(--portal-danger);
    color: white;
}

.portal-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.portal-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.portal-btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* Forms */
.portal-form-group {
    margin-bottom: 20px;
}

.portal-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--portal-gray-700);
    margin-bottom: 6px;
}

.portal-form-label-required::after {
    content: " *";
    color: var(--portal-danger);
}

.portal-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--portal-gray-300);
    border-radius: var(--portal-border-radius);
    font-size: 14px;
    transition: all 0.2s;
}

.portal-form-input:focus {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.portal-form-input-error {
    border-color: var(--portal-danger);
}

.portal-form-error {
    color: var(--portal-danger);
    font-size: 13px;
    margin-top: 4px;
}

.portal-form-help {
    color: var(--portal-gray-500);
    font-size: 13px;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .portal-header-container,
    .portal-nav-container,
    .portal-container,
    .portal-footer-container {
        padding: 0 16px;
    }

    .portal-welcome {
        display: none;
    }

    .portal-nav-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .portal-nav-item {
        flex-shrink: 0;
        padding: 0 16px;
        font-size: 14px;
    }

    .portal-footer-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* Loading Spinner */
.portal-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.portal-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--portal-gray-500);
}

.portal-empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.portal-empty-state-text {
    font-size: 18px;
    margin-bottom: 8px;
}

.portal-empty-state-subtext {
    font-size: 14px;
}
