/* ========== SITES PAGE STYLES ========== */
/* Page-specific styles - Dark Industrial Theme */

/* ========== PAGE CONTAINER ========== */
.sites-container {
    padding: 1rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* ========== HEADER ========== */
.sites-header {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 8px;
    color: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sites-header h1 {
    color: #00bcd4;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 1px;
    margin: 0;
}

.sites-header h1 i {
    margin-right: 0.75rem;
}

/* ========== SITES GRID ========== */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 0.8rem;
    margin-top: 0.8rem;
    align-items: stretch;
}

/* ========== SITE CARD ========== */
.site-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    color: white;
    cursor: pointer;
    width: 100%;
}

.site-card:hover {
    border-color: rgba(0, 188, 212, 0.3);
    background: rgba(0, 188, 212, 0.05);
    transform: translateY(-2px);
}

.sites-grid-virtualized {
    grid-template-columns: minmax(0, 1fr);
    max-height: 68vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.35rem;
}

/* Virtualize renders leading and trailing spacer elements beside the cards.
   Keep those spacers on their own row so they cannot consume a card column. */
.sites-grid-virtualized > :not(.site-card) {
    grid-column: 1 / -1;
    width: 100%;
}

.sites-grid > .site-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

.sites-grid > .site-card .site-card-body {
    flex: 1 1 auto;
}

.sites-loading-card {
    min-height: 320px;
    display: flex;
    align-items: stretch;
    cursor: default;
}

.sites-loading-card:hover {
    transform: none;
}

.site-card-header {
    background: rgba(0, 188, 212, 0.05);
    border-bottom: 1px solid rgba(0, 188, 212, 0.1);
    padding: 0.75rem;
    border-radius: 8px 8px 0 0;
}

.site-card-header h4 {
    color: #00bcd4;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 400;
}

.site-card-body {
    padding: 0.75rem;
}

.site-card-footer {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========== SITE INFO ITEM ========== */
.site-info-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.site-info-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.site-info-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* ========== SITES STATS OVERVIEW ========== */
.sites-page .stats-overview {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 8px;
    color: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ========== FILTER SECTION ========== */
.sites-page .filter-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 8px;
    color: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* ========== ADD SITE BUTTON ========== */
.add-site-button {
    background: transparent;
    color: #4caf50;
    border: 1px solid #4caf50;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-site-button:hover {
    background: rgba(76, 175, 80, 0.1);
}

.add-site-button i {
    margin-right: 0.5rem;
}

/* ========== NOT ASSIGNED BADGE ========== */
.not-assigned-badge {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* ========== SITE STATUS BADGES ========== */
.site-status-active {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.site-status-inactive {
    background: rgba(158, 158, 158, 0.15);
    color: #9e9e9e;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

/* ========== RESPONSIVE - Large Desktop ========== */
@media (min-width: 1600px) {
    .sites-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== RESPONSIVE - Desktop ========== */
@media (min-width: 1200px) and (max-width: 1599px) {
    .sites-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========== RESPONSIVE - Medium Screens ========== */
@media (min-width: 769px) and (max-width: 1199px) {
    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== RESPONSIVE - Mobile ========== */
@media (max-width: 768px) {
    .sites-container {
        padding: 0.5rem;
    }

    .sites-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .sites-grid {
        grid-template-columns: 1fr;
    }

    .sites-container :is(.add-site-button, .site-card-footer button, .site-card-footer .e-btn) {
        min-height: 44px;
    }
}
