/* Carroun Road Dispute - Solicitor Onboarding Portal
   Shared Stylesheet v1.0
   ================================================== */

:root {
    --primary-color: #1a365d;
    --secondary-color: #2c5282;
    --accent-color: #3182ce;
    --success-color: #38a169;
    --warning-color: #d69e2e;
    --danger-color: #e53e3e;
    --bg-color: #f7fafc;
    --card-bg: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --border-color: #e2e8f0;
    --timeline-line: #cbd5e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.nav-brand:hover {
    opacity: 0.9;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    list-style: none;
    background: rgba(0,0,0,0.15);
    padding: 10px 15px;
    border-radius: 12px;
    margin: 0;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    white-space: nowrap;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-1px);
}

.nav-links a.active {
    background: rgba(255,255,255,0.25);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 1100px) {
    .nav-toggle {
        display: block;
    }

    .nav-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 15px;
        gap: 5px;
        margin-top: 10px;
        background: rgba(0,0,0,0.2);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        display: block;
        padding: 12px 20px;
        font-size: 0.95rem;
        text-align: center;
        border-radius: 8px;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(255,255,255,0.15);
    }
}

@media (min-width: 1101px) {
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .nav-links {
        flex: 1;
        margin-left: 20px;
        justify-content: flex-end;
    }
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 50px 20px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
    margin-bottom: 15px;
}

.header .case-ref {
    padding: 10px 25px;
    background: rgba(255,255,255,0.15);
    border-radius: 25px;
    display: inline-block;
    font-size: 0.95rem;
}

/* Page Header (smaller for sub-pages) */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header .subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
}

.card-accent {
    border-left: 5px solid var(--accent-color);
}

.card-warning {
    border-left: 5px solid var(--warning-color);
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.card-danger {
    border-left: 5px solid var(--danger-color);
    background: linear-gradient(135deg, #fff5f5, #fed7d7);
}

.card-success {
    border-left: 5px solid var(--success-color);
    background: linear-gradient(135deg, #f0fff4, #c6f6d5);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

/* Quick Links / Navigation Cards */
.nav-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    display: block;
}

.nav-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(49, 130, 206, 0.2);
}

.nav-card .icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.nav-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.nav-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.nav-card .count {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-top: 10px;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: var(--timeline-line);
    border-radius: 2px;
}

@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    width: 50%;
    padding-right: 50px;
}

.timeline-item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: 50px;
}

@media (max-width: 768px) {
    .timeline-item,
    .timeline-item:nth-child(even) {
        width: 100%;
        margin-left: 0;
        padding-left: 50px;
        padding-right: 0;
    }
}

.timeline-marker {
    position: absolute;
    right: -12px;
    top: 25px;
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    border: 4px solid var(--card-bg);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.timeline-item:nth-child(even) .timeline-marker {
    right: auto;
    left: -12px;
}

@media (max-width: 768px) {
    .timeline-marker,
    .timeline-item:nth-child(even) .timeline-marker {
        left: 8px;
        right: auto;
    }
}

.timeline-marker.key-event {
    background: var(--warning-color);
    width: 28px;
    height: 28px;
    right: -14px;
}

.timeline-item:nth-child(even) .timeline-marker.key-event {
    left: -14px;
}

.timeline-marker.critical { background: var(--danger-color); }
.timeline-marker.success { background: var(--success-color); }

.timeline-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.timeline-date {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.timeline-date.critical {
    background: var(--danger-color);
}

.timeline-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.timeline-direction {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.direction-arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.direction-arrow.outgoing {
    background: #e6fffa;
    color: #319795;
}

.direction-arrow.incoming {
    background: #ebf8ff;
    color: #3182ce;
}

.timeline-body {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.timeline-body p {
    margin-bottom: 10px;
}

/* Phase Dividers */
.phase-divider {
    text-align: center;
    margin: 50px 0;
    position: relative;
}

.phase-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
}

.phase-divider span {
    position: relative;
    background: var(--bg-color);
    padding: 10px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    border: 2px solid var(--border-color);
    border-radius: 25px;
}

.phase-divider.critical span {
    background: #7f1d1d;
    color: white;
    border-color: #7f1d1d;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 5px;
    margin-bottom: 5px;
}

.tag-key { background: #fef3c7; color: #92400e; }
.tag-document { background: #e0e7ff; color: #3730a3; }
.tag-meeting { background: #d1fae5; color: #065f46; }
.tag-urgent { background: #fee2e2; color: #991b1b; }
.tag-payment { background: #dbeafe; color: #1e40af; }
.tag-escalation { background: #7f1d1d; color: white; }
.tag-whatsapp { background: #dcfce7; color: #166534; }
.tag-legal { background: #fae8ff; color: #86198f; }

/* Key Points */
.key-point {
    background: linear-gradient(90deg, #fef3c7, #fde68a);
    padding: 12px 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid var(--warning-color);
    font-weight: 500;
    color: #92400e;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.4);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--primary-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    background: white;
}

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

.btn-danger:hover {
    background: #c53030;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--primary-color);
}

.data-table tr:hover {
    background: var(--bg-color);
}

/* Document List */
.doc-list {
    list-style: none;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.doc-item:hover {
    background: var(--bg-color);
}

.doc-item:last-child {
    border-bottom: none;
}

.doc-icon {
    width: 45px;
    height: 45px;
    background: var(--accent-color);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.doc-icon.pdf { background: #dc2626; }
.doc-icon.doc { background: #2563eb; }
.doc-icon.img { background: #059669; }
.doc-icon.eml { background: #7c3aed; }

.doc-info {
    flex-grow: 1;
}

.doc-info h4 {
    color: var(--primary-color);
    margin-bottom: 3px;
    font-size: 1rem;
}

.doc-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.doc-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--accent-color);
    transition: all 0.3s ease;
}

.doc-link:hover {
    background: var(--accent-color);
    color: white;
}

/* Chat/WhatsApp Styles */
.chat-container {
    max-width: 700px;
    margin: 0 auto;
}

.chat-message {
    display: flex;
    margin-bottom: 15px;
}

.chat-message.sent {
    justify-content: flex-end;
}

.chat-message.received {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 18px;
    position: relative;
}

.chat-message.sent .chat-bubble {
    background: #dcf8c6;
    border-bottom-right-radius: 4px;
}

.chat-message.received .chat-bubble {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chat-sender {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.chat-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 5px;
    text-align: right;
}

.chat-date-divider {
    text-align: center;
    margin: 25px 0;
}

.chat-date-divider span {
    background: var(--bg-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Modal Styles */
#modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

#modal-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-container {
    display: none;
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    margin: 40px auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-meta-item strong {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 3px;
}

.email-content {
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-item {
    text-align: center;
    padding: 25px 15px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 30px 20px;
    text-align: center;
    margin-top: 50px;
}

.footer p {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: var(--text-secondary); }

/* Print Styles */
@media print {
    .navbar, .nav-card, .btn, .modal-overlay {
        display: none !important;
    }

    body {
        background: white;
    }

    .card, .timeline-content {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}
