/**
 * Client Portal Styles
 * Extends thy.finance base styles with client-specific components
 */

/* Portal Container */
.portal-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Portal Header */
.portal-header {
    background: var(--bg-secondary);
    padding: 20px 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-header-left h1 {
    color: var(--accent-primary);
    margin-bottom: 5px;
}

.portal-header-left p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.portal-header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-card-icon {
    font-size: 2rem;
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 5px;
}

.stat-card-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Content Cards */
.content-card {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    margin-bottom: 30px;
}

.content-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.content-card-header h2 {
    color: var(--accent-primary);
    font-size: 1.5rem;
}

/* Buttons - Professional Design System */
.btn {
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.btn:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Primary Action Buttons (High emphasis - Bright Blue) */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* Feature Action Buttons (Medium emphasis - Light Blue) */
.btn-feature {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-feature:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
    transform: translateY(-1px);
}

/* System Action Buttons (Automation/AI - Deep Blue) */
.btn-system {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-system:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
    transform: translateY(-1px);
}

/* Critical Action Button (Tax/Important - Teal Blue) */
.btn-critical {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-critical:hover {
    background: linear-gradient(135deg, #0e7490 0%, #155e75 100%);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.4);
    transform: translateY(-1px);
}

/* Secondary Buttons (Low emphasis - Slate Blue) */
.btn-secondary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.4);
    transform: translateY(-1px);
}

/* Danger Buttons */
.btn-danger {
    background: #ef4444;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

/* Button Sizes */
.btn-small {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: 5px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 8px;
}

/* Button with Icon */
.btn-icon {
    padding: 8px 12px;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* Disabled state */
.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Button Group - Tile Style */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

.btn-group .btn {
    flex: 1;
    min-width: 160px;
    justify-content: center;
    text-align: center;
    min-height: 48px;
    padding: 12px 16px;
    gap: 8px;
}

.btn-group .btn svg {
    width: 18px;
    height: 18px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead tr {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    padding: 15px;
    text-align: left;
    color: var(--accent-primary);
    font-weight: 600;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Lists */
.item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.item-list-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.item-list-item:last-child {
    border-bottom: none;
}

.item-list-item:hover {
    background: var(--bg-tertiary);
}

.item-list-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #22c55e;
    color: white;
}

.badge-warning {
    background: #f59e0b;
    color: white;
}

.badge-danger {
    background: #ef4444;
    color: white;
}

.badge-info {
    background: var(--accent-primary);
    color: white;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #22c55e;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #f59e0b;
}

.alert-info {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auth Pages */
.auth-container {
    max-width: 500px;
    margin: 100px auto;
    padding: 20px;
}

.auth-card {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--accent-primary);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.auth-footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Password Strength Indicator */
.password-strength {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
}

.password-strength-weak .password-strength-bar {
    width: 33%;
    background: #ef4444;
}

.password-strength-medium .password-strength-bar {
    width: 66%;
    background: #f59e0b;
}

.password-strength-strong .password-strength-bar {
    width: 100%;
    background: #22c55e;
}

/* Responsive */
@media (max-width: 768px) {
    .portal-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .portal-header-right {
        flex-direction: column;
        width: 100%;
    }

    .portal-header-right .btn {
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
    }
}
