/* Force consistent container width */
.container {
    width: 100% !important;
}

/* Archive Page Styles */
.archive-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.archive-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.archive-main {
    flex: 1;
}

.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.archive-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d3436;
    display: flex;
    align-items: center;
    gap: 12px;
}

.archive-count {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Sidebar Filters */
.filters-sidebar {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e9ecef;
}

.filters-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group:last-of-type {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    font-size: 0.8rem;
    color: #636e72;
    font-weight: 500;
    margin-bottom: 6px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #f8f9fa;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.filter-btn {
    width: 100%;
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-btn:hover {
    background: #059669;
}

.filter-reset {
    display: block;
    text-align: center;
    color: #636e72;
    text-decoration: none;
    font-size: 0.8rem;
    margin-top: 10px;
}

.filter-reset:hover {
    color: #2d3436;
}

/* Archive Grid - CSS Grid */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    min-height: 400px;
    width: 100%;
}

.archive-grid.archive-grid-empty {
    display: flex;
    min-height: 500px;
    min-width: 800px;
}

.archive-grid.archive-grid-empty .archive-empty {
    flex: 1;
    min-height: 100%;
}

.archive-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e9ecef;
    transition: transform 0.2s, box-shadow 0.2s;
}

@media (max-width: 1200px) {
    .archive-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .archive-grid {
        grid-template-columns: 1fr;
    }
}

/* Theme: SafeMode */
body.theme-delicate .archive-title {
    font-family: var(--font-display);
    color: var(--ink);
}

body.theme-delicate .archive-count {
    background: var(--ink);
}

body.theme-delicate .filters-sidebar,
body.theme-delicate .archive-card,
body.theme-delicate .archive-empty {
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    position: relative;
}

body.theme-delicate .filters-sidebar::before,
body.theme-delicate .archive-card::before,
body.theme-delicate .archive-empty::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 10px;
    border: 1px solid rgba(31, 31, 31, 0.2);
    pointer-events: none;
}

body.theme-delicate .filters-title,
body.theme-delicate .filter-group label {
    color: var(--ink);
}

body.theme-delicate .filter-group select,
body.theme-delicate .filter-group input {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
}

body.theme-delicate .filter-group select:focus,
body.theme-delicate .filter-group input:focus {
    border-color: var(--line);
    box-shadow: 0 0 0 2px rgba(31, 31, 31, 0.2);
}

body.theme-delicate .filter-btn {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    box-shadow: var(--shadow-soft);
}

body.theme-delicate .filter-btn:hover {
    box-shadow: var(--shadow);
}

body.theme-delicate .filter-reset {
    color: var(--ink-muted);
}

body.theme-delicate .archive-empty {
    border-style: solid;
}

.archive-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    color: #636e72;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
    min-height: 450px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.archive-empty-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.5;
}

.archive-empty h3 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    color: #2d3436;
    font-weight: 700;
}

.archive-empty p {
    font-size: 1.1rem;
    color: #636e72;
    max-width: 400px;
}

.archive-empty .filter-reset {
    margin-top: 24px;
    display: inline-block;
    padding: 10px 24px;
    background: #10b981;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.archive-empty .filter-reset:hover {
    background: #059669;
    color: white;
}

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

/* Browser Mockup */
.browser-frame {
    background: #f1f3f4;
    overflow: hidden;
}

.browser-bar {
    background: linear-gradient(180deg, #e8eaed 0%, #dee1e6 100%);
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #d3d6db;
}

.browser-dots {
    display: flex;
    gap: 4px;
}

.browser-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.browser-dots span:nth-child(1) { background: #ff5f57; }
.browser-dots span:nth-child(2) { background: #febc2e; }
.browser-dots span:nth-child(3) { background: #28c840; }

.browser-url {
    flex: 1;
    background: #fff;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.65rem;
    color: #5f6368;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: -apple-system, system-ui, sans-serif;
}

.archive-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    object-position: top;
    background: #fff;
    cursor: pointer;
    display: block;
}

.archive-card-body {
    padding: 16px;
}

.archive-card-brand {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.archive-card-brand .flag {
    font-size: 0.8rem;
}

.archive-card-domain {
    font-size: 0.8rem;
    color: #636e72;
    margin-bottom: 10px;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 4px;
}

.archive-card-domain .flag {
    font-size: 0.75rem;
}

.archive-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.archive-card-time {
    color: #b2bec3;
    font-size: 0.75rem;
}

.archive-card-confidence {
    background: #f1f3f4;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.archive-card-confidence.high {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #047857;
}

.archive-card-confidence.medium {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
}

.archive-card-confidence.low {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #b91c1c;
}

.archive-card-category {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.intel-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Pagination */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #ffffff;
    color: #2d3436;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background: #f8f9fa;
    border-color: #10b981;
}

.pagination-btn.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.pagination-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.pagination-info {
    color: #636e72;
    font-size: 0.9rem;
    margin: 0 16px;
}

/* Per page selector */
.per-page-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.per-page-selector label {
    font-size: 0.85rem;
    color: #636e72;
}

.per-page-selector select {
    padding: 6px 10px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Back to stats link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #10b981;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 20px;
}

.back-link:hover {
    text-decoration: underline;
}

/* Modal for enlarged screenshots */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    max-width: 90vw;
    max-height: 90vh;
}

.modal-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-info {
    text-align: center;
    color: white;
    margin-top: 16px;
}

.modal-brand {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.8;
}

.modal-close:hover {
    opacity: 1;
}

/* Registration Modal */
.registration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.reg-modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.reg-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #b2bec3;
    cursor: pointer;
}

.reg-modal-close:hover {
    color: #2d3436;
}

.reg-modal-content h2 {
    font-size: 1.5rem;
    color: #2d3436;
    margin-bottom: 12px;
}

.reg-modal-content > p {
    color: #636e72;
    margin-bottom: 24px;
    line-height: 1.5;
}

.reg-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
}

.google-btn {
    background: white;
    border: 2px solid #e9ecef;
    color: #2d3436;
}

.google-btn:hover {
    background: #f8f9fa;
    border-color: #ddd;
}

.email-btn {
    background: #10b981;
    color: white;
    border: none;
}

.email-btn:hover {
    background: #059669;
}

.reg-divider {
    display: flex;
    align-items: center;
    margin: 8px 0;
}

.reg-divider::before,
.reg-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e9ecef;
}

.reg-divider span {
    padding: 0 12px;
    color: #b2bec3;
    font-size: 0.85rem;
}

.reg-login {
    margin-top: 20px;
    color: #636e72;
    font-size: 0.9rem;
}

.reg-login a {
    color: #10b981;
    text-decoration: none;
    font-weight: 500;
}

.reg-login a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
    .archive-layout {
        flex-direction: column;
    }

    .archive-sidebar {
        width: 100%;
        position: static;
        order: -1;
    }

    .filters-sidebar {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px;
    }

    .filters-title {
        width: 100%;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .filter-group {
        flex: 1;
        min-width: 150px;
        margin-bottom: 0;
    }

    .filter-btn {
        flex: 0 0 auto;
        width: auto;
        padding: 8px 24px;
    }
}

@media (max-width: 768px) {
    .archive-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-sidebar {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .pagination-bar {
        flex-direction: column;
    }

    .per-page-selector {
        margin-left: 0;
        margin-top: 16px;
    }
}
