/* 
 * Terms Archive Modal Styles
 * Styles for viewing archived terms versions
 */

/* Archive List Modal */
.terms-archive-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modal-fade-in 0.3s ease;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.terms-archive-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modal-slide-up 0.3s ease;
}

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

.terms-archive-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terms-archive-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #100f0d;
}

.close-archive-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
    min-width: 44px;
    min-height: 44px;
}

.close-archive-modal:hover {
    color: #100f0d;
}

.terms-archive-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.loading-indicator {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.loading-indicator i {
    margin-right: 0.5rem;
}

.archive-item {
    padding: 1.25rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.archive-item:hover {
    border-color: #5e60ce;
    box-shadow: 0 4px 12px rgba(94, 96, 206, 0.1);
}

.archive-item.current {
    background: linear-gradient(135deg, rgba(94, 96, 206, 0.05), rgba(94, 96, 206, 0.02));
    border-color: #5e60ce;
}

.archive-date {
    font-weight: 600;
    color: #100f0d;
    margin-bottom: 0.25rem;
}

.archive-description {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.archive-change-notes {
    color: #6c757d;
    font-size: 0.875rem;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.archive-current-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #28a745;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.archive-view-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #5e60ce;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.archive-view-link:hover {
    background: #100f0d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 15, 13, 0.2);
}

.archive-empty,
.archive-error {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.archive-empty i,
.archive-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Terms View Modal (for viewing a specific archived version) */
.terms-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terms-view-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.terms-view-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    height: 85vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    animation: view-modal-enter 0.3s ease;
}

@keyframes view-modal-enter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.terms-view-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, white);
    border-radius: 12px 12px 0 0;
}

.terms-view-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #100f0d;
}

.close-view-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s;
    min-width: 44px;
    min-height: 44px;
    border-radius: 6px;
}

.close-view-modal:hover {
    color: #100f0d;
    background: rgba(0, 0, 0, 0.05);
}

.terms-view-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    line-height: 1.6;
}

/* Scrollbar styling for terms view body */
.terms-view-body::-webkit-scrollbar {
    width: 8px;
}

.terms-view-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.terms-view-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.terms-view-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Archive version info header */
.archive-version-info {
    background: linear-gradient(135deg, rgba(94, 96, 206, 0.05), rgba(94, 96, 206, 0.02));
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #5e60ce;
}

.archive-version-info .effective-date {
    font-weight: 600;
    color: #100f0d;
    margin: 0 0 0.5rem 0;
}

.archive-version-info .change-notes {
    color: #6c757d;
    font-size: 0.875rem;
    margin: 0;
}

/* Terms content styling within modal */
.terms-content-archived {
    font-size: 0.95rem;
}

.terms-content-archived .terms-section {
    position: relative;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.terms-content-archived .terms-section:hover {
    border-color: #5e60ce;
    box-shadow: 0 4px 12px rgba(94, 96, 206, 0.05);
}

.terms-content-archived .section-number {
    position: absolute;
    top: 1.5rem;
    left: -0.75rem;
    background: #5e60ce;
    color: white;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.terms-content-archived h2 {
    margin-left: 1.5rem;
    color: #100f0d;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.terms-content-archived h3 {
    color: #4a4a4a;
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.terms-content-archived p {
    margin: 0.75rem 0;
    color: #212529;
}

.terms-content-archived ul,
.terms-content-archived .enhanced-list {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.terms-content-archived li {
    margin: 0.5rem 0;
    color: #212529;
    line-height: 1.6;
}

.terms-content-archived strong {
    font-weight: 600;
    color: #100f0d;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .terms-archive-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .terms-view-modal-content {
        width: 95%;
        height: 90vh;
        max-height: 95vh;
        margin: 1rem;
    }
    
    .terms-view-header,
    .terms-archive-header {
        padding: 1rem;
    }
    
    .terms-view-header h2,
    .terms-archive-header h2 {
        font-size: 1.25rem;
    }
    
    .terms-view-body {
        padding: 1rem;
    }
    
    .terms-content-archived .terms-section {
        padding: 1rem;
    }
    
    .terms-content-archived .section-number {
        position: static;
        display: inline-flex;
        margin-bottom: 0.5rem;
    }
    
    .terms-content-archived h2 {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .terms-archive-modal-content,
    .terms-view-modal-content {
        width: calc(100% - 2rem);
        border-radius: 8px;
    }
    
    .archive-item {
        padding: 1rem;
    }
    
    .archive-view-link {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode support */
body.dark-mode .terms-archive-modal-content,
body.dark-mode .terms-view-modal-content {
    background: #1e1e1e;
}

body.dark-mode .terms-archive-header,
body.dark-mode .terms-view-header {
    background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
    border-color: #444;
}

body.dark-mode .terms-archive-header h2,
body.dark-mode .terms-view-header h2 {
    color: #e0e0e0;
}

body.dark-mode .close-archive-modal,
body.dark-mode .close-view-modal {
    color: #aaa;
}

body.dark-mode .close-archive-modal:hover,
body.dark-mode .close-view-modal:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .archive-item {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode .archive-item:hover {
    border-color: #bb86fc;
    box-shadow: 0 4px 12px rgba(187, 134, 252, 0.2);
}

body.dark-mode .archive-item.current {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.1), rgba(187, 134, 252, 0.05));
}

body.dark-mode .archive-date,
body.dark-mode .archive-version-info .effective-date {
    color: #e0e0e0;
}

body.dark-mode .archive-description,
body.dark-mode .archive-change-notes,
body.dark-mode .archive-version-info .change-notes {
    color: #aaa;
}

body.dark-mode .archive-change-notes {
    background: #333;
}

body.dark-mode .archive-view-link {
    background: #bb86fc;
}

body.dark-mode .archive-view-link:hover {
    background: #9d4edd;
}

body.dark-mode .terms-view-body {
    color: #aaa;
}

body.dark-mode .archive-version-info {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.1), rgba(187, 134, 252, 0.05));
    border-color: #bb86fc;
}

body.dark-mode .terms-content-archived .terms-section {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode .terms-content-archived .terms-section:hover {
    border-color: #bb86fc;
    box-shadow: 0 4px 12px rgba(187, 134, 252, 0.1);
}

body.dark-mode .terms-content-archived .section-number {
    background: #bb86fc;
}

body.dark-mode .terms-content-archived h2,
body.dark-mode .terms-content-archived h3 {
    color: #e0e0e0;
}

body.dark-mode .terms-content-archived p,
body.dark-mode .terms-content-archived li {
    color: #aaa;
}

body.dark-mode .terms-content-archived strong {
    color: #e0e0e0;
}

/* Print styles */
@media print {
    .terms-archive-modal,
    .terms-view-modal {
        display: none !important;
    }
}