/* DiF v5 - Legal Page Styles */

/* Legal Page Container - full-width layout */
.legal-page {
    min-height: 100vh;
    background-color: #f5f5f0;
    width: 100%;
    max-width: 100%;
}

.legal-page-inner {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem 2rem;
    margin: 0;
    box-sizing: border-box;
}

/* Hero Section */
.legal-hero {
    background: linear-gradient(135deg, #8b9d83 0%, #a67c52 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.legal-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.legal-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.legal-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.meta-item i {
    width: 16px;
    text-align: center;
}

/* Main Container */
.legal-container {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
    padding: 2rem;
}

/* Table of Contents */
.legal-toc {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    top: 2rem;
    box-shadow: 0 2px 4px -1px rgb(0 0 0 / 0.1);
}

.legal-toc-mobile {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 2px 4px -1px rgb(0 0 0 / 0.1);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.toc-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.toc-controls {
    display: flex;
    gap: 0.5rem;
}

.toc-controls .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.toc-nav {
    margin: 0;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--bs-body-color, #212529);
    text-decoration: none;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    line-height: 1.3;
}

.toc-link:hover {
    background-color: #8b9d83;
    color: white;
    text-decoration: none;
}

.toc-link.active {
    background-color: #8b9d83;
    color: white;
    font-weight: 500;
}

/* Accordion Styles */
.legal-accordion {
    margin-bottom: 3rem;
}

.legal-accordion .accordion-item {
    border: 1px solid #e9ecef;
    border-radius: 0.75rem !important;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 4px -1px rgb(0 0 0 / 0.1);
}

.legal-accordion .accordion-button {
    background-color: #f8f9fa;
    border: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1.25rem 1.5rem;
    color: #2d3748;
    box-shadow: none;
    border-radius: 0;
}

.legal-accordion .accordion-button:not(.collapsed) {
    background-color: #8b9d83;
    color: white;
}

.legal-accordion .accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(139, 157, 131, 0.25);
}

.legal-accordion .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.legal-accordion .accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.legal-accordion .accordion-body {
    padding: 2rem;
    background-color: #ffffff;
}

/* Content Styling */
.legal-accordion h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #8b9d83;
}

.legal-accordion h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

.legal-accordion h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    color: #2d3748;
}

.legal-accordion p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.legal-accordion ul, .legal-accordion ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-accordion li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.legal-accordion blockquote {
    border-left: 4px solid #8b9d83;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    background-color: #f8f9fa;
    padding: 1rem 1rem 1rem 1.5rem;
    border-radius: 0.5rem;
}

.legal-accordion a {
    color: #8b9d83;
    text-decoration: none;
}

.legal-accordion a:hover {
    text-decoration: underline;
}

/* Token Table Styling */
.token-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 4px -1px rgb(0 0 0 / 0.1);
}

.token-table th {
    background-color: #8b9d83;
    color: white;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border: none;
}

.token-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.token-table tr:last-child td {
    border-bottom: none;
}

.token-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.token-table .role-name {
    font-weight: 600;
}

.token-table .token-count {
    text-align: right;
    font-family: monospace;
}

.token-table .price {
    text-align: right;
    font-weight: 500;
}

.token-table .description {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Progressive Messages */
.progressive-messages {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 4px -1px rgb(0 0 0 / 0.1);
}

.progressive-messages h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #8b9d83;
}

.message-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    border-left: 3px solid #a67c52;
}

.message-item:last-child {
    margin-bottom: 0;
}

.message-percentage {
    font-weight: 600;
    color: #8b9d83;
    min-width: 40px;
}

.message-text {
    flex: 1;
    font-style: italic;
    color: #2d3748;
}

/* Footer Utilities */
.legal-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 2rem;
    margin-top: 2rem;
}

.footer-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Notice Blocks */
.notice-block {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 4px -1px rgb(0 0 0 / 0.1);
}

.notice-block i {
    color: #856404;
    font-size: 1.2rem;
}

.notice-block p {
    margin: 0;
    color: #856404;
    font-weight: 500;
}

.notice-block .btn {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .legal-title {
        font-size: 2.5rem;
    }
    
    .legal-subtitle {
        font-size: 1.1rem;
    }
    
    .legal-meta {
        align-items: flex-start;
        margin-top: 1rem;
    }
    
    .toc-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .toc-controls {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .legal-hero {
        padding: 2rem 0;
    }
    
    .legal-title {
        font-size: 2rem;
    }
    
    .legal-subtitle {
        font-size: 1rem;
    }
    
    .legal-accordion .accordion-body {
        padding: 1.5rem;
    }
    
    .footer-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .footer-actions .btn {
        justify-content: center;
    }
    
    /* Token table responsive */
    .token-table-container {
        overflow-x: auto;
        margin: 1rem -1rem;
        padding: 0 1rem;
    }
    
    .token-table {
        min-width: 600px;
    }
}

@media (max-width: 575.98px) {
    .legal-container {
        padding: 0 0.5rem;
    }
    
    .legal-accordion .accordion-body {
        padding: 1rem;
    }
    
    .token-table th,
    .token-table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .legal-hero {
        background: none !important;
        color: black !important;
        padding: 1rem 0 !important;
        border-bottom: 2px solid black;
    }
    
    .legal-toc,
    .legal-toc-mobile,
    .toc-controls,
    .footer-actions,
    .notice-block {
        display: none !important;
    }
    
    .legal-accordion .accordion-collapse {
        display: block !important;
    }
    
    .legal-accordion .accordion-button {
        background: none !important;
        color: black !important;
        padding: 0.5rem 0 !important;
        font-size: 1.2rem !important;
        border-bottom: 1px solid black !important;
    }
    
    .legal-accordion .accordion-button::after {
        display: none !important;
    }
    
    .legal-accordion .accordion-body {
        padding: 0.5rem 0 1rem 0 !important;
        background: none !important;
    }
    
    .token-table {
        border: 1px solid black !important;
    }
    
    .token-table th {
        background: #f0f0f0 !important;
        color: black !important;
    }
    
    .token-table td {
        border-bottom: 1px solid #ccc !important;
    }
    
    .progressive-messages {
        border: 1px solid black !important;
        background: #f9f9f9 !important;
    }
    
    .message-item {
        background: white !important;
        border-left: 3px solid black !important;
    }
    
    /* Add print footer with last updated */
    .legal-page::after {
        content: "Last updated: " attr(data-last-updated);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 0.8rem;
        color: #666;
        background: white;
        padding: 0.5rem;
        border-top: 1px solid #ccc;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .legal-accordion .accordion-button,
    .toc-link,
    .notice-block {
        transition: none !important;
    }
    
    .legal-hero {
        background: #8b9d83 !important;
    }
}

/* Dark Mode Support - Disabled to maintain site's light theme */
/* The legal page will always use the light theme to match the rest of the site */

/* Eli Introduction Section */
.eli-intro-section {
    margin: 0 0 2rem 0;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #8b9d83;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
}

.eli-intro-section::before {
    content: '';
    position: absolute;
    left: 220px;
    top: 30px;
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-right: 20px solid #8b9d83;
}

.eli-intro-section::after {
    content: '';
    position: absolute;
    left: 222px;
    top: 32px;
    width: 0;
    height: 0;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
    border-right: 18px solid #f8f9fa;
}

.eli-portrait-container {
    flex-shrink: 0;
}

.eli-portrait {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #8b9d83;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.eli-intro-content {
    flex: 1;
    min-width: 0;
}

.eli-intro-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.eli-intro-byline {
    font-size: 0.9rem;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 1rem;
}

.eli-intro-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #4a5568;
}

.eli-intro-text p {
    margin-bottom: 1rem;
}

.eli-intro-text p:last-child {
    margin-bottom: 0;
}

/* Responsive Design for Eli Intro */
@media (max-width: 767.98px) {
    .eli-intro-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }
    
    .eli-intro-section::before,
    .eli-intro-section::after {
        display: none;
    }
    
    .eli-portrait {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 575.98px) {
    .eli-intro-section {
        padding: 1rem;
    }
    
    .eli-portrait {
        width: 120px;
        height: 120px;
    }
    
    .eli-intro-title {
        font-size: 1.25rem;
    }
    
    .eli-intro-text {
        font-size: 0.95rem;
    }
}