﻿/* ============================================================================
   FILE: wwwroot/css/site.css
   Taylor Emmet Client Portal - Styling
   Uses CSS variables from ThemeProvider (loaded from PortalBranding table)
   ============================================================================ */

/* ============================================================================
   LOCAL UTILITIES (shadows, radii - not in branding table)
   ============================================================================ */
:root {
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family, 'Aptos', 'Segoe UI', sans-serif);
    background-color: var(--bg, #f8f9fa);
    color: var(--text-primary, #2c3e50);
    margin: 0;
    padding: 0;
}

.page-wrapper {
    min-height: 100vh;
}

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary, #1a6b5a) 0%, var(--secondary, #2c3e50) 100%);
    padding: 2rem;
}

.login-container {
    display: flex;
    max-width: 900px;
    width: 100%;
    background: var(--card-bg, #ffffff);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.login-card {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-placeholder {
    margin-bottom: 1rem;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary, #1a6b5a);
    letter-spacing: -0.5px;
}

.login-header h1 {
    font-size: 1.5rem;
    color: var(--primary, #1a6b5a);
    margin: 0.5rem 0;
    font-weight: var(--heading-weight, 600);
}

.tagline {
    color: var(--accent, #e8a430);
    font-style: italic;
    margin: 0;
}

.login-body {
    flex: 1;
}

    .login-body .form-label {
        font-weight: 500;
        color: var(--text-primary, #2c3e50);
    }

    .login-body .form-control {
        padding: 0.75rem 1rem;
        border: 1px solid var(--border, #dee2e6);
        border-radius: var(--radius-sm);
        transition: border-color 0.2s, box-shadow 0.2s;
        font-family: var(--font-family, 'Aptos', 'Segoe UI', sans-serif);
    }

        .login-body .form-control:focus {
            border-color: var(--primary, #1a6b5a);
            box-shadow: 0 0 0 3px rgba(26, 107, 90, 0.1);
        }

.btn-login {
    background: var(--primary, #1a6b5a);
    border: none;
    padding: 0.875rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    color: var(--text-light, #ffffff);
    font-family: var(--font-family, 'Aptos', 'Segoe UI', sans-serif);
}

    .btn-login:hover {
        background: var(--primary-hover, #145a4b);
    }

.login-links {
    text-align: center;
    font-size: 0.875rem;
}

    .login-links a {
        color: var(--primary, #1a6b5a);
        text-decoration: none;
    }

        .login-links a:hover {
            text-decoration: underline;
        }

    .login-links .separator {
        color: var(--border, #dee2e6);
        margin: 0 0.75rem;
    }

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #dee2e6);
}

    .login-footer p {
        color: var(--text-secondary, #6c757d);
        font-size: 0.8rem;
        margin: 0;
    }

    .login-footer i {
        color: var(--success, #28a745);
        margin-right: 0.5rem;
    }

.login-side-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--primary, #1a6b5a) 0%, var(--primary-hover, #145a4b) 100%);
    color: var(--text-light, #ffffff);
    padding: 3rem;
    display: flex;
    align-items: center;
}

.side-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: var(--heading-weight, 600);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

    .feature-list li {
        display: flex;
        align-items: center;
        margin-bottom: 1rem;
        font-size: 0.95rem;
    }

    .feature-list i {
        color: var(--accent, #e8a430);
        margin-right: 0.75rem;
        font-size: 1.1rem;
    }

.trust-badge {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: var(--radius-md);
}

    .trust-badge i {
        color: var(--accent, #e8a430);
        font-size: 1.25rem;
        margin-right: 0.75rem;
    }

    .trust-badge span {
        font-size: 0.9rem;
    }

/* ============================================================================
   PORTAL LAYOUT
   ============================================================================ */
.portal-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-header {
    background: var(--sidebar-bg, #1a6b5a);
    color: var(--sidebar-text, #ffffff);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-placeholder-small span {
    font-size: 1.25rem;
    font-weight: 700;
}

.portal-title {
    font-size: 0.9rem;
    opacity: 0.8;
    padding-left: 1rem;
    border-left: 1px solid rgba(255,255,255,0.2);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-text {
    font-size: 0.9rem;
}

.user-menu {
    color: var(--sidebar-text, #ffffff);
    font-size: 1.5rem;
    padding: 0;
}

    .user-menu:hover {
        color: var(--accent, #e8a430);
    }

/* ============================================================================
   MAIN CONTENT AREA
   ============================================================================ */
.portal-content {
    flex: 1;
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.content-main {
    flex: 1;
    min-width: 0;
}

.content-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* ============================================================================
   ACTION BANNER
   ============================================================================ */
.action-banner {
    background: linear-gradient(90deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid var(--warning, #ffc107);
    border-left: 4px solid var(--warning, #ffc107);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-icon {
    font-size: 1.5rem;
    color: #856404;
}

.action-text {
    flex: 1;
    color: #856404;
}

/* ============================================================================
   MATTER CARD
   ============================================================================ */
.matter-card {
    background: var(--card-bg, #ffffff);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.matter-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border, #dee2e6);
}

.matter-info h2 {
    font-size: 1.5rem;
    color: var(--primary, #1a6b5a);
    margin: 0 0 0.25rem 0;
    font-weight: var(--heading-weight, 600);
}

.matter-ref {
    color: var(--text-secondary, #6c757d);
    font-size: 0.875rem;
    margin: 0;
}

.matter-type-badge {
    background: var(--primary, #1a6b5a);
    color: var(--text-light, #ffffff);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Fee Earner Section */
.fee-earner-section {
    display: flex;
    gap: 1rem;
    background: var(--bg, #f8f9fa);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.fee-earner-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary, #1a6b5a);
    color: var(--text-light, #ffffff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.fee-earner-details {
    flex: 1;
}

.fe-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.25rem 0;
}

.fe-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary, #1a6b5a);
    margin: 0 0 0.5rem 0;
}

.fe-contact {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

    .fe-contact a {
        color: var(--primary, #1a6b5a);
        text-decoration: none;
    }

        .fe-contact a:hover {
            color: var(--accent, #e8a430);
        }

    .fe-contact i {
        width: 1.25rem;
        color: var(--text-secondary, #6c757d);
    }

/* ============================================================================
   MILESTONE TIMELINE
   ============================================================================ */
.milestone-section h4 {
    font-size: 1.1rem;
    color: var(--primary, #1a6b5a);
    font-weight: var(--heading-weight, 600);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .milestone-section h4 i {
        color: var(--text-secondary, #6c757d);
    }

.milestone-timeline {
    position: relative;
    margin-top: 1.25rem;
    padding-left: 40px;
}

    .milestone-timeline::before {
        content: '';
        position: absolute;
        left: 12px;
        top: 12px;
        bottom: 12px;
        width: 2px;
        background: var(--border, #dee2e6);
    }

.milestone-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 0;
}

    .milestone-item:first-child {
        padding-top: 0;
    }

    .milestone-item:last-child {
        padding-bottom: 0;
    }

.milestone-marker {
    position: absolute;
    left: -40px;
    top: 0.5rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background: var(--card-bg, #ffffff);
    border-radius: 50%;
}

.milestone-item:first-child .milestone-marker {
    top: 0;
}

/* Completed */
.milestone-item.completed .milestone-marker i {
    color: var(--success, #28a745);
    font-size: 1.25rem;
}

.milestone-item.completed .milestone-name {
    color: var(--text-primary, #2c3e50);
    font-weight: 500;
}

.milestone-item.completed .milestone-content {
    padding: 0.25rem 0;
}

/* Current */
.milestone-item.current .milestone-marker {
    background: var(--primary, #1a6b5a);
    width: 30px;
    height: 30px;
    left: -43px;
    box-shadow: 0 0 0 4px rgba(26, 107, 90, 0.15), var(--shadow-sm);
}

    .milestone-item.current .milestone-marker i {
        color: var(--text-light, #ffffff);
        font-size: 1rem;
    }

.milestone-item.current .milestone-content {
    background: linear-gradient(135deg, rgba(26, 107, 90, 0.04) 0%, rgba(26, 107, 90, 0.08) 100%);
    border: 1px solid rgba(26, 107, 90, 0.12);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
}

.milestone-item.current .milestone-name {
    color: var(--primary, #1a6b5a);
    font-weight: 700;
    font-size: 1rem;
}

.milestone-item.current .milestone-notes {
    color: var(--primary-hover, #145a4b);
}

/* Pending */
.milestone-item.pending .milestone-marker i {
    color: #ccc;
    font-size: 1rem;
}

.milestone-item.pending .milestone-content {
    padding: 0.125rem 0;
}

.milestone-item.pending .milestone-name {
    color: #adb5bd;
    font-weight: 400;
    font-size: 0.875rem;
}

/* Content area */
.milestone-content {
    flex: 1;
    min-width: 0;
}

.milestone-name {
    font-size: 0.925rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    display: block;
}

.milestone-notes {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.825rem;
    line-height: 1.5;
    color: var(--text-secondary, #6c757d);
}

.milestone-date {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.375rem;
    font-size: 0.8rem;
    background: rgba(40, 167, 69, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
}

    .milestone-date i {
        font-size: 0.75rem;
    }

/* Green connecting line */
.milestone-item.completed + .milestone-item.completed .milestone-marker::before,
.milestone-item.completed + .milestone-item.current .milestone-marker::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    width: 2px;
    height: calc(100% + 1rem);
    background: var(--success, #28a745);
    transform: translateX(-50%);
    z-index: -1;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */
.portal-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    max-width: 420px;
    min-width: 300px;
}

    .portal-toast.toast-success {
        background: var(--primary, #1a6b5a);
        color: var(--text-light, #ffffff);
    }

    .portal-toast.toast-error {
        background: var(--danger, #dc3545);
        color: var(--text-light, #ffffff);
    }

    .portal-toast .toast-icon {
        font-size: 1.25rem;
        flex-shrink: 0;
    }

.toast-success .toast-icon {
    color: #6fdc8c;
}

.toast-error .toast-icon {
    color: #ffc9c9;
}

.portal-toast .toast-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.portal-toast .toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

    .portal-toast .toast-close:hover {
        color: var(--text-light, #ffffff);
    }

/* Animations */
.portal-toast.fade-in {
    animation: toastSlideIn 0.4s ease-out;
}

.portal-toast.fade-out {
    animation: toastSlideOut 0.4s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(1rem) translateX(1rem);
    }

    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }

    to {
        opacity: 0;
        transform: translateY(1rem) translateX(1rem);
    }
}

/* ============================================================================
   SIDEBAR - SERVICES PANEL & FOOTER
   Add this to the end of site.css
   ============================================================================ */

/* Services Panel */
.services-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.services-list {
    background: var(--card-bg, #ffffff);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
}

    .services-list h4 {
        font-size: 1rem;
        font-weight: var(--heading-weight, 600);
        color: var(--primary, #1a6b5a);
        margin: 0 0 0.25rem 0;
    }

.services-intro {
    font-size: 0.8rem;
    color: var(--text-secondary, #6c757d);
    margin: 0 0 1rem 0;
}

.service-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .service-items li {
        border-bottom: 1px solid var(--border, #dee2e6);
    }

        .service-items li:last-child {
            border-bottom: none;
        }

        .service-items li a {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.7rem 0.25rem;
            text-decoration: none;
            color: var(--text-primary, #2c3e50);
            transition: background 0.15s, padding-left 0.15s;
            border-radius: 4px;
        }

            .service-items li a:hover {
                background: var(--bg, #f8f9fa);
                padding-left: 0.5rem;
            }

            .service-items li a > i:first-child {
                font-size: 1.1rem;
                color: var(--primary, #1a6b5a);
                width: 1.5rem;
                text-align: center;
                flex-shrink: 0;
            }

.service-info {
    flex: 1;
    min-width: 0;
}

.service-name {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary, #2c3e50);
}

.service-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary, #6c757d);
}

.service-items li a > i.bi-chevron-right {
    font-size: 0.7rem;
    color: var(--text-secondary, #6c757d);
    flex-shrink: 0;
}

.explore-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--primary, #1a6b5a);
    text-decoration: none;
    font-weight: 500;
}

    .explore-link:hover {
        text-decoration: underline;
    }

/* Contextual Prompt */
.contextual-prompt {
    background: linear-gradient(135deg, rgba(26, 107, 90, 0.04) 0%, rgba(26, 107, 90, 0.08) 100%);
    border: 1px solid rgba(26, 107, 90, 0.15);
    border-radius: var(--radius-lg, 12px);
    padding: 1.25rem;
    position: relative;
}

    .contextual-prompt .dismiss-btn {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        background: none;
        border: none;
        color: var(--text-secondary, #6c757d);
        cursor: pointer;
        font-size: 1.1rem;
        padding: 0.25rem;
        line-height: 1;
    }

        .contextual-prompt .dismiss-btn:hover {
            color: var(--text-primary, #2c3e50);
        }

    .contextual-prompt .prompt-icon {
        font-size: 1.5rem;
        color: var(--primary, #1a6b5a);
        margin-bottom: 0.5rem;
    }

    .contextual-prompt h5 {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--primary, #1a6b5a);
        margin: 0 0 0.5rem 0;
    }

    .contextual-prompt p {
        font-size: 0.85rem;
        color: var(--text-secondary, #6c757d);
        margin: 0 0 0.75rem 0;
        line-height: 1.5;
    }

.prompt-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

    .prompt-actions .btn-primary {
        background: var(--primary, #1a6b5a);
        border: none;
        font-size: 0.8rem;
        padding: 0.35rem 0.75rem;
    }

        .prompt-actions .btn-primary:hover {
            background: var(--primary-hover, #145a4b);
        }

    .prompt-actions .btn-link {
        font-size: 0.8rem;
        color: var(--text-secondary, #6c757d);
        text-decoration: none;
        padding: 0.35rem 0.5rem;
    }

/* Contact Card */
.contact-card {
    background: var(--card-bg, #ffffff);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
    text-align: center;
}

    .contact-card h5 {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--primary, #1a6b5a);
        margin: 0 0 0.25rem 0;
    }

    .contact-card p {
        font-size: 0.8rem;
        color: var(--text-secondary, #6c757d);
        margin: 0 0 0.75rem 0;
    }

    .contact-card .btn-outline-primary {
        color: var(--primary, #1a6b5a);
        border-color: var(--primary, #1a6b5a);
        font-size: 0.85rem;
    }

        .contact-card .btn-outline-primary:hover {
            background: var(--primary, #1a6b5a);
            color: var(--text-light, #ffffff);
        }

/* Section Card (for documents/messages) */
.section-card {
    background: var(--card-bg, #ffffff);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

    .section-header h3 {
        font-size: 1.1rem;
        font-weight: var(--heading-weight, 600);
        color: var(--primary, #1a6b5a);
        margin: 0;
    }

/* Messages List */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-item {
    padding: 0.75rem;
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border, #dee2e6);
}

    .message-item.unread {
        background: rgba(26, 107, 90, 0.03);
        border-left: 3px solid var(--primary, #1a6b5a);
    }

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-subject {
    font-weight: 400;
    color: var(--text-secondary, #6c757d);
}

.message-body {
    font-size: 0.875rem;
    color: var(--text-primary, #2c3e50);
    line-height: 1.5;
}

/* Footer */
.portal-footer {
    background: var(--secondary, #2c3e50);
    color: var(--text-light, #ffffff);
    padding: 1.5rem;
    margin-top: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

    .footer-links a {
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        font-size: 0.85rem;
    }

        .footer-links a:hover {
            color: var(--text-light, #ffffff);
        }

.footer-info {
    text-align: center;
}

    .footer-info p {
        margin: 0.25rem 0;
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.5);
    }