/* Monitor Page Specific Styles */

.monitor-container {
    width: min(100%, 1100px);
    margin: 40px auto 30px;
    /* Added 40px top margin to clear nav */
    padding: 0 clamp(0.4rem, 4vw, 1.2rem);
}

.header-section {
    text-align: center;
    margin-bottom: 40px;
}

.header-section h1 {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 800;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

.last-updated {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #888;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.5);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
}

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

/* Card Styles */
.stat-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.zone-icon {
    font-size: 1.5rem;
    margin-right: 12px;
}

.stat-card h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #333;
    font-weight: 700;
}

/* Metrics */
.main-metric {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 16px;
    font-weight: 800;
}

.seen-count {
    font-size: 3.5rem;
    color: #2c3e50;
    line-height: 1;
}

.separator {
    font-size: 2rem;
    color: #ccc;
    margin: 0 8px;
}

.total-count {
    font-size: 2rem;
    color: #7f8c8d;
}

.unit {
    font-size: 1rem;
    color: #95a5a6;
    margin-left: 8px;
    font-weight: 600;
}

/* Progress Bar */
.progress-container {
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease-in-out;
}

/* Zone Specific Colors */
.green-zone .progress-bar {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.green-zone .seen-count {
    color: #27ae60;
}

.yellow-zone .progress-bar {
    background: linear-gradient(90deg, #f1c40f, #f39c12);
}

.yellow-zone .seen-count {
    color: #d35400;
}

.red-zone .progress-bar {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.red-zone .seen-count {
    color: #c0392b;
}

/* Breach Stats */
.breach-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: rgba(255, 255, 255, 0.5);
    padding: 16px;
    border-radius: 16px;
}

.breach-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.breach-item .label {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breach-item .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #34495e;
}

.breach-item.warning .value {
    color: #d35400;
}

/* Responsive */
/* Responsive Horizontal Scroll for Mobile */
/* Responsive Compact Mobile Layout */
@media (max-width: 768px) {
    .monitor-container {
        width: 100%;
        margin-bottom: 20px;
        /* Padding handled by grid gap */
    }

    .header-section {
        margin-bottom: 15px;
    }

    .header-section h1 {
        font-size: 1.5rem;
    }

    .stats-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 0;
        /* Remove extra padding, let container handle it */
        overflow: visible;
    }

    /* Hide scrollbar styles not needed anymore */
    .stats-grid::-webkit-scrollbar {
        display: none;
    }

    .stat-card {
        min-width: 0;
        /* Allow shrinking */
        max-width: none;
        padding: 12px 8px;
        /* Compact padding */
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stat-card:hover {
        transform: none;
        /* Disable hover lift on mobile */
    }

    .card-header {
        flex-direction: column;
        margin-bottom: 8px;
        width: 100%;
    }

    .zone-icon {
        font-size: 1.2rem;
        margin-right: 0;
        margin-bottom: 4px;
    }

    .stat-card h2 {
        font-size: 0.9rem;
        /* Smaller title */
        white-space: nowrap;
    }

    /* Main Metric scaling */
    .main-metric {
        margin-bottom: 8px;
        flex-direction: column;
        /* Stack numbers if very tight, or keep row? Row is efficient if small. */
        flex-direction: row;
        align-items: baseline;
    }

    .seen-count {
        font-size: 1.8rem;
        /* Much smaller */
    }

    .separator {
        font-size: 1.2rem;
        margin: 0 2px;
    }

    .total-count {
        font-size: 1.2rem;
    }

    .unit {
        display: none;
        /* Hide "Seen" text to save space */
    }

    /* Progress Bar */
    .progress-container {
        height: 6px;
        margin-bottom: 10px;
        width: 100%;
    }

    /* Breach Stats - Compact */
    .breach-stats {
        display: grid;
        grid-template-columns: 1fr;
        /* Stack vertically or 1fr 1fr? 1fr 1fr might be too squeezed. */
        gap: 4px;
        padding: 6px;
        width: 100%;
        background: rgba(255, 255, 255, 0.4);
    }

    .breach-item {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    .breach-item .label {
        font-size: 0.65rem;
        margin-bottom: 0;
    }

    .breach-item .value {
        font-size: 0.9rem;
        margin-left: 4px;
    }
}

/* Screenshot Modal */
.modal-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.3s ease-out;
}

.modal-content {
    width: 100%;
    display: flex;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    border: 1px solid #eee;
}

.modal-actions {
    margin-top: 15px;
    display: flex;
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-close {
    background: #f1f1f1;
    color: #333;
}

.btn-close:hover {
    background: #e0e0e0;
}

.btn-download {
    background: #007bff;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.btn-download:hover {
    background: #0056b3;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Live Screenshot Content */
.btn-live-screenshot {
    background: #4361ee;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s;
    cursor: pointer;
    border: none;
    margin-left: 10px;
}

.btn-live-screenshot:hover {
    background: #3b52d1;
    transform: translateY(-1px);
}

.btn-live-screenshot:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Swiper Internal Logic */
.dashboard .card.complex-card {
    padding: 0 !important;
    margin-top: 0 !important;
    display: block !important;
}

.swiper-container {
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: row;
    /* FORCE ROW */
}

.swiper-wrapper {
    display: flex;
    flex-direction: row;
    /* FORCE ROW */
    width: auto;
    /* Let content dictate width */
    min-width: 100%;
}

.swiper-slide {
    min-width: 100%;
    flex: 0 0 100%;
    /* FORCE it to not shrink */
    scroll-snap-align: center;
    padding: 0.5rem clamp(1rem, 3vw, 1.5rem) 1.5rem;
    /* Drastically reduced top padding (0.5rem) */
    box-sizing: border-box;
}

/* Remove default margins from headers inside swiper to save space */
.swiper-slide .header-section,
.swiper-slide h1,
.swiper-slide h2 {
    margin-top: 5px !important;
}

/* Screenshot Slide Specifics */
.screenshot-slide {
    display: flex;
    flex-direction: column;
    text-align: center;
    min-height: 400px;
}

/* Header for Screenshot Slide (matches existing h1 style) */
.screenshot-slide h2 {
    font-size: 2rem;
    margin-bottom: 5px;
    font-weight: 800;
    color: #1a1a1a;
}

.screenshot-placeholder {
    width: 100%;
    height: 300px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    margin-bottom: 20px;
    border: 2px dashed rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    flex-grow: 1;
}

.screenshot-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
    /* Hidden until loaded */
}

.screenshot-placeholder img.loaded {
    display: block;
}

.screenshot-placeholder.has-image {
    background: transparent;
    border: none;
}

/* Pagination Dots */
.swiper-pagination {
    display: flex;
    justify-content: center;
    padding: 10px 0 15px;
    background: rgba(255, 255, 255, 0.4);
}

.swiper-dot {
    width: 8px;
    height: 8px;
    margin: 0 4px;
    border-radius: 50%;
    background: #ccc;
    transition: background 0.3s;
}

.swiper-dot.active {
    background: #4361ee;
}