/* Navigation styles inspired by the demo */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.65;
    background: linear-gradient(135deg, #f5f7fa 0%, #f1f5f9 100%);
    color: #2d3748;
    min-height: 100vh;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 70px;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.nav-menu {
    padding: 1.5rem 0;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    padding: 0 1.5rem 0.75rem 1.5rem;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: #f8fafc;
    color: #1e293b;
    border-left-color: #cbd5e1;
}

.nav-item.active {
    background: #f1f5f9;
    color: #1e293b;
    border-left-color: #4299e1;
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.nav-text {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-item {
    padding: 0.75rem;
    justify-content: center;
    width: 70px;
    overflow: hidden;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

/* User info in collapsed state */
.sidebar.collapsed .user-info {
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .user-details {
    display: none;
}

.sidebar.collapsed .sign-out-btn {
    display: none;
}

.sidebar.collapsed .user-avatar {
    margin-bottom: 0;
}

.sidebar.collapsed .user-avatar img {
    width: 32px;
    height: 32px;
}

/* Loading states in sidebar */
.loading-nav {
    padding: 0.75rem 1.5rem;
    color: #64748b;
    font-size: 0.875rem;
    font-style: italic;
}

.no-types {
    padding: 0.75rem 1.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    transition: margin-left 0.3s ease;
    max-width: calc(100vw - 280px);
    overflow-x: hidden;
}







.sidebar.collapsed + .main-content {
    margin-left: 70px;
    max-width: calc(100vw - 70px);
}

/* Page Sections */
.page-section {
    display: none;
    width: 100%;
    position: relative;
}

.page-section.active {
    display: block;
    width: 100%;
}

/* Page Headers */
.page-header {
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #1a202c;
}

.page-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

/* Document Viewer */
.document-viewer {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.8);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.document-nav {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap; /* Allow wrapping for long tab names */
}

.document-nav-item {
    flex: 1;
    min-width: 120px; /* Prevent tabs from being too narrow */
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    font-family: inherit;
    text-align: center;
}

.document-nav-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.document-nav-item.active {
    background: #fff;
    color: #1e293b;
    border-bottom-color: #4299e1;
    font-weight: 600;
}

/* Document Content Styles */
.document-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 3rem;
    min-height: 400px;
    line-height: 1.7;
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Document content formatting */
.document-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    color: #1a202c;
    border-bottom: 3px solid #4299e1;
    padding-bottom: 0.75rem;
    width: 100%;
}

.document-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: #1a202c;
}

.document-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
    color: #1a202c;
}

.document-content p {
    margin-bottom: 1.25rem;
    color: #374151;
    font-size: 1rem;
}

.document-content ul, .document-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.document-content li {
    margin-bottom: 0.5rem;
    color: #374151;
}

.document-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-left: 4px solid #4299e1;
    color: #4a5568;
    font-style: italic;
}

.document-content code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
}

.document-content pre {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

.document-content a {
    color: #4299e1;
    text-decoration: underline;
    cursor: pointer;
    transition: all 0.2s ease;
}

.document-content a:hover {
    color: #3182ce;
    background: rgba(66, 153, 225, 0.1);
    border-radius: 2px;
}

/* Image styling - key fix for large images */
.document-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Large images should be more reasonable in size */
.document-content img[src*="timeline"], 
.document-content img[src*="chart"],
.document-content img[width], 
.document-content img[height] {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    margin: 1.5rem 0;
}

/* Tables */
.document-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.document-content th, 
.document-content td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.document-content th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

/* Quotable sentence styles */
.sentence {
    cursor: pointer;
    padding: 0.1rem 0.2rem;
    margin: 0 0.1rem;
    border-radius: 3px;
    transition: all 0.2s ease;
    position: relative;
}

.sentence:hover {
    background: rgba(66, 153, 225, 0.1);
    color: #1e40af;
}

.sentence.selected {
    background: rgba(66, 153, 225, 0.2);
    color: #1e40af;
    font-weight: 500;
}

.sentence.highlighted {
    background: rgba(251, 191, 36, 0.3);
    color: #92400e;
    font-weight: 500;
}

/* Quotability status notification */
.quotability-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: none;
}

.quotability-status.success {
    background: #10b981;
    color: white;
}

.quotability-status.error {
    background: #ef4444;
    color: white;
}

.quotability-status.info {
    background: #3b82f6;
    color: white;
}

/* Animation for status */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.quotability-status[style*="block"] {
    animation: slideIn 0.3s ease;
}

/* Document content in navigation context */
.document-content .quotable-content {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.document-content .quotable-content h1:first-child {
    margin-top: 0;
}

/* No content message */
.no-content {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-style: italic;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn:hover {
    border-color: #4299e1;
    color: #4299e1;
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border-color: #4299e1;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

/* Cards Grid (kept for compatibility) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Document Cards (kept for compatibility) */
.document-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

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

/* Type-based card styling */
.document-card.foundational {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #fff 0%, #faf5ff 100%);
}

.document-card.three-one-two {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
}

.document-card.norms {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
}

/* Card Content */
.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.card-description {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.5;
    margin: 0 0 1rem 0;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.card-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Type badges */
.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.type-badge.foundational {
    background: #8b5cf6;
    color: white;
}

.type-badge.three-one-two {
    background: #f59e0b;
    color: white;
}

.type-badge.norms {
    background: #ef4444;
    color: white;
}

/* Squad Documents Dashboard Styles */
.squad-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    margin-top: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 0 1rem;
}

.squad-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 220px;
    height: auto;
}

.squad-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12), 0 3px 6px rgba(0,0,0,0.08);
    border-color: #4299e1;
    border-width: 2px;
}

.squad-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.squad-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.squad-card-month {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    margin-left: 1rem;
    white-space: nowrap;
}

.squad-card-headline {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.6;
    margin: 0 0 2.5rem 0;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-height: 120px;
}

.squad-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.squad-status-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
}

.squad-status-badge.needs-review {
    background: #fef3c7;
    color: #92400e;
}

.squad-status-badge.ready-for-decision {
    background: #dcfce7;
    color: #166534;
}

.squad-status-badge.approved {
    background: #dbeafe;
    color: #1e40af;
}

.squad-status-badge.approved-conditions {
    background: #fef3c7;
    color: #92400e;
}

.squad-status-badge.rejected {
    background: #fee2e2;
    color: #991b1b;
}

.squad-card-meta {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Squad document header and content */
.squad-document-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.squad-document-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.squad-month-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.squad-month-nav button {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
}

.squad-month-nav button:hover:not(:disabled) {
    border-color: #4299e1;
    color: #4299e1;
}

.squad-month-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.squad-month-display {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a202c;
    min-width: 100px;
    text-align: center;
}

.squad-document-content {
    padding: 2rem 3rem;
    line-height: 1.7;
    width: 100%;
}

/* Squad document section */
.squad-document-section {
    margin-bottom: 2rem;
    width: 100%;
}

.squad-document-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: #1a202c;
    width: 100%;
}

.squad-document-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
    color: #1a202c;
    width: 100%;
}

.squad-section-summary {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    font-style: italic;
    color: #0369a1;
}

.squad-section-summary strong {
    font-style: normal;
    display: block;
    margin-bottom: 0.75rem;
}

.squad-expand-link {
    color: #8b5cf6;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.squad-expand-link:hover {
    text-decoration: underline;
}

.squad-section-expanded {
    margin-top: 1rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.adr-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.adr-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.adr-item h3 {
    margin-top: 0;
    color: #1a202c;
    font-size: 1.125rem;
    font-weight: 600;
}

.adr-item h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.adr-item p {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #4a5568;
    line-height: 1.5;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1002;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    border-color: #4299e1;
    color: #4299e1;
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    #squad-documents-page .month-selector {
        top: 0 !important;
        right: 0 !important;
        max-width: calc(100% - 2rem);
        font-size: 0.875rem !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        color: inherit !important;
        cursor: default !important;
        display: flex !important;
    }

    #squad-doc-page .squad-month-nav {
        top: 0.125rem !important;
        right: 0 !important;
        max-width: calc(100% - 2rem);
        font-size: 0.875rem !important;
        padding: 0.75rem 1.5rem !important;
        border: 1px solid #d1d5db !important;
        background: #f3f4f6 !important;
        color: #374151 !important;
        cursor: default !important;
        display: flex !important;
        border-radius: 8px !important;
        font-weight: 600 !important;
        transition: all 0.2s ease !important;
        line-height: 1 !important;
        height: 2.75rem !important;
        box-sizing: border-box !important;
        justify-content: center !important;
    }

    #squad-doc-page .squad-month-nav:hover {
        background: #e5e7eb !important;
        transform: translateY(-1px) !important;
    }

    .squad-doc-content-wrapper {
        position: relative;
    }
    
    .sidebar {
        transform: translateX(-100%); /* Hide sidebar off-screen */
        transition: transform 0.3s ease;
        position: fixed;
        z-index: 1001;
    }
    
    .sidebar.show {
        transform: translateX(0); /* Show sidebar when needed */
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 1rem;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .sidebar.collapsed + .main-content {
        margin-left: 0 !important;
    }
    
    .page-header {
        padding: 1.5rem 2rem;
    }
    
    .document-content {
        max-width: 100%;
        padding: 2rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .document-nav {
        flex-wrap: wrap;
    }
    
    .document-nav-item {
        flex: none;
        min-width: 120px;
    }
    
    .squad-cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .squad-card {
        padding: 1.5rem;
        min-height: 200px;
    }
    
    .squad-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .squad-card-month {
        margin-left: 0;
    }

    .squad-card-headline {
        margin: 0 0 1.5rem 0;
        line-height: 1.5;
        min-height: 100px;
    }

    .squad-card-footer {
        padding-top: 1rem;
    }
    
    .squad-document-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem 2rem;
    }
    
    .squad-document-content {
        padding: 1.5rem 2rem;
    }
} 