/* Status Screen Dashboard CSS v1.1.4 */

@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000000;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    max-height: 100vh;
    overflow: hidden;
}

/* Block styling */
.block {
    background: #000000;
    border: 1px solid #cccccc;
    padding: 8px;
    position: relative;
    overflow: hidden;
}

.block-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 20px;
    opacity: 1;
}

.block-updated {
    position: absolute;
    right: 40px;
    top: 12px;
    font-size: 11px;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Top Row - 30% */
.top-row {
    display: flex;
    gap: 10px;
    height: 30%;
}

.registrations-block {
    flex: 0 0 25%;
    overflow-y: auto;
}

.events-notifications {
    flex: 1;
    display: flex;
    gap: 10px;
}

.upcoming-events {
    flex: 1.6;
    overflow-y: auto;
    max-height: 100%;
}

.notifications {
    flex: 0.9;
    overflow-y: auto;
    max-height: 100%;
}

/* Middle Row - 30% */
.middle-row {
    display: flex;
    gap: 10px;
    height: 30%;
}

.system-status {
    flex: 0 0 25%;
    overflow-y: auto;
}

/* Active Events */
.active-events {
    flex: 1;
    overflow-y: auto;
}

#active-events-table {
    width: 100%;
}

#active-events-table thead th {
    text-align: left;
}

#active-events-table thead th:nth-child(1) { width: 30%; }
#active-events-table thead th:nth-child(2) { width: 10%; }
#active-events-table thead th:nth-child(3) { width: 35%; }
#active-events-table thead th:nth-child(4) { width: 25%; }

#active-events-table tbody tr {
    border: none;
}

#active-events-table tbody td {
    padding: 0;
    border: none;
}

.event-item {
    padding: 8px 6px;
    border-bottom: 1px solid #333;
}

tr:last-child .event-item {
    border-bottom: none;
}

.event-main-row {
    display: grid;
    grid-template-columns: 30% 10% 35% 25%;
    gap: 6px;
    align-items: center;
    margin-bottom: 2px;
    font-size: 14px;
}

.event-main-row > *:first-child {
    font-weight: 600;
}

.event-detail-row {
    display: grid;
    grid-template-columns: 30% 10% 35% 25%;
    gap: 6px;
    font-size: 11px;
    color: #999;
}

.event-detail-row span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Clocks Row */
.clocks-row {
    flex: 1;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px 0;
    position: relative;
}

.weather-updated {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 10;
}

.clock-container {
    text-align: center;
}

.clock {
    width: 180px;
    height: 180px;
    border: 2px solid #333;
    border-radius: 50%;
    position: relative;
    background: #000000;
    overflow: hidden;
}

.clock-weather {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    z-index: 1;
}

.clock-hand {
    position: absolute;
    background: #ffffff;
    transform-origin: bottom center;
    bottom: 50%;
    left: 50%;
    z-index: 10;
}

.hour-hand {
    width: 4px;
    height: 35%;
    margin-left: -2px;
    background: #ffffff;
}

.minute-hand {
    width: 3px;
    height: 45%;
    margin-left: -1.5px;
    background: #ffffff;
}

.clock-time {
    margin-top: 10px;
    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
}

.clock-timezone {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* News Ticker */
.news-ticker {
    background: #000000;
    border-top: 1px solid #1a1a1a;
    height: 40px;
    overflow: hidden;
    position: relative;
    font-family: 'Courier Prime', monospace;
    display: flex;
    align-items: center;
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    margin-right: 140px; /* Space for the timestamp */
}

.ticker-content {
    display: inline-flex;
    animation: scroll 270s linear infinite;
    white-space: nowrap;
    align-items: center;
    height: 100%;
    padding-left: 100%;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    padding: 0 50px;
    color: #FFD645;
    font-size: 14px;
}

.news-updated {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #666;
    background: #000000;
    padding: 2px 8px;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Headers */
h2 {
    font-size: 20px;
    margin-bottom: 5px;
    color: #ffffff;
    font-weight: 600;
}

h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #FFD645;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

td, th {
    padding: 2px 6px;
    text-align: left;
    border-bottom: 1px solid #1a1a1a;
    line-height: 1.3;
}

th {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
}

/* Registration Stats - Simple Table */
.registrations-table {
    width: 100%;
}

.registrations-table td {
    padding: 0 8px;
    line-height: 1.2;
}

.registrations-table tr {
    border-bottom: none;
}

.stat-label {
    color: #999;
    font-size: 14px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: #FFD645;
    text-align: right;
}

/* Notifications */
.notification-date-group {
    margin-bottom: 10px;
}

.notification-date {
    font-size: 13px;
    color: #FFD645;
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid #cccccc;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 3px 0;
    margin-left: 10px;
    line-height: 1.3;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.warning {
    border-left: 3px solid #FFD645;
    padding-left: 7px;
    margin-left: 7px;
}

.notification-item.error {
    border-left: 3px solid #FF4545;
    padding-left: 7px;
    margin-left: 7px;
}

.notification-time {
    font-size: 11px;
    color: #666;
    margin-right: 10px;
    min-width: 40px;
}

/* System Status */
.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    border-bottom: 1px solid #1a1a1a;
    line-height: 1.3;
}

.status-item:last-child {
    border-bottom: none;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.status-normal { background: #45FF45; }
.status-warning { background: #FFD645; }
.status-critical { background: #FF4545; }

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #333;
}

/* Loading animation */
.loading {
    opacity: 0.5;
    transition: opacity 0.3s;
}

/* Pulse animation for updates */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.updating {
    animation: pulse 1s ease-in-out;
}

/* Dummy content styling */
.dummy-content {
    opacity: 0.3;
}

.clock-weather i {
    font-size: 60px;
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        display: block;
    }

    .container {
        padding: 5px;
        gap: 5px;
        max-height: none;
        overflow: visible;
        display: block;
    }

    /* Make all rows stack vertically */
    .top-row, .middle-row {
        flex-direction: column;
        height: auto;
        display: block;
    }

    /* Reset all block widths and heights */
    .block {
        width: 100%;
        max-width: 100%;
        min-height: 200px;
        max-height: none;
        margin-bottom: 10px;
    }

    .registrations-block,
    .system-status,
    .active-events {
        flex: 1 1 auto;
        width: 100%;
    }

    .events-notifications {
        flex-direction: column;
        display: block;
    }

    .upcoming-events,
    .notifications {
        flex: 1 1 auto;
        min-height: 250px;
        max-height: none;
    }

    /* Adjust clocks for mobile */
    .clocks-row {
        flex-wrap: wrap;
        padding: 10px 0;
        min-height: auto;
        height: auto;
        justify-content: center;
        gap: 20px;
        margin-bottom: 10px;
    }

    .clock {
        width: 120px;
        height: 120px;
    }

    .clock-weather {
        font-size: 60px;
    }

    .clock-weather i {
        font-size: 40px;
    }

    .weather-updated {
        position: static;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    /* News ticker at bottom */
    .news-ticker {
        position: relative;
        height: 35px;
        margin-top: 10px;
    }

    /* Active Events mobile adjustments */
    .event-main-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .event-detail-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    /* Adjust text sizes */
    h2 {
        font-size: 18px;
    }

    .stat-value {
        font-size: 18px;
    }

    td, th {
        font-size: 12px;
        padding: 1px 4px;
    }

    .ticker-item {
        font-size: 12px;
        padding: 0 30px;
    }

    .ticker-wrapper {
        margin-right: 100px;
    }

    /* Block icon and timestamp adjustments */
    .block-icon {
        font-size: 16px;
        top: 5px;
        right: 5px;
    }

    .block-updated {
        font-size: 10px;
        right: 30px;
        top: 8px;
    }
}