/* Reset box-sizing for consistent padding/borders */
*, *::before, *::after {


    box-sizing: border-box;
}

body {
    background-color: #30313D;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
    margin: 0;
}

.timer-frame {
    display: inline-block;
    padding: clamp(15px, 4vw, 30px);
    border: 2px solid #06AB78;
    border-radius: 24px;
    background: rgba(40, 167, 69, 0.05);
    margin: 20px auto;
    width: 90%;
    max-width: 1000px;
}

.timer-frame-show {
    display: inline-block;
    padding: clamp(20px, 5vw, 50px);
    border: 4px solid #06AB78;
    border-radius: 28px;
    background: rgba(40, 167, 69, 0.08);
    margin: clamp(15px, 3vw, 30px) auto;
    width: 95%;
    max-width: 1200px;
}

.timer-display, #timer-display {
    font-size: clamp(48px, 10vw, 96px);
    padding: clamp(10px, 2vw, 20px);
    background: #ffffff;
    color: black;
    border-radius: 12px;
    display: inline-block;
    min-width: min(300px, 80vw);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.timer-display-show {
    font-size: clamp(80px, 20vw, 280px);
    padding: clamp(20px, 5vw, 60px) clamp(30px, 6vw, 90px);
    background: #ffffff;
    color: black;
    border-radius: 16px;
    display: block;
    min-width: min(200px, 45vw);
    min-height: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.button {
    padding: 12px 24px;
    margin: 5px;
    font-size: clamp(14px, 2vw, 18px);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.start-btn {
    background-color: #06AB78;
    color: white;
}

.start-btn:hover {
    background-color: #059267;
}

.pause-btn {
    background-color: #ff9800;
    color: white;
}

.pause-btn:hover {
    background-color: #e68900;
}

.reset-btn {
    background-color: #f44336;
    color: white;
}

.reset-btn:hover {
    background-color: #da190b;
}

.timer-status, #timer-status {
    margin-top: 15px;
    font-size: clamp(14px, 2vw, 18px);
    color: #30313D;
}


.timers-row {
    display: flex;
    gap: clamp(10px, 2vw, 20px);
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 10px;
}

.event-card-home {
    background-color: rgba(40, 167, 69, 0.05);
    padding: clamp(8px, 1.5vw, 12px) clamp(10px, 2vw, 16px); /* responsive padding */
    border-radius: 8px;
    flex: 1 1 200px; /* flexible width */
    min-width: 180px; /* don't shrink too small */
    max-width: 300px; /* limit max size */
    text-align: center;
    color: #30313D;
    box-sizing: border-box;
    margin: 10px; /* spacing between cards */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Optional hover effect */
.event-card-home:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Container for cards */
.event-cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* center cards on smaller screens */
    gap: 10px; /* space between cards */
}

/* Mobile-specific adjustments */
@media (max-width: 640px) {
    .event-card-home {
        flex: 1 1 90%; /* almost full width on small screens */
        min-width: 90%; /* ensure it fills container */
        max-width: 100%;
        padding: 12px 16px;
    }
}


.event-card-home.selected {
    border: 2px solid #06AB78;
}

.event-card {
    background-color: rgba(0, 128, 0, 0.2);
    padding: 10px 15px;
    border-radius: 8px;
    min-width: min(200px, calc(100% - 20px));
    flex: 1 1 200px;
    max-width: 300px;
    text-align: center;
    color: #30313D;
}

.event-card {
    background-color: rgba(40, 167, 69, 0.05);
    padding: clamp(8px, 1.5vw, 10px) clamp(10px, 2vw, 15px);
    border-radius: 8px;
    min-width: min(200px, calc(100% - 20px));
    flex: 1 1 200px;
    max-width: 300px;
    text-align: center;
    color: #30313D;
}

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .event-card {
        padding: 8px 12px;
        min-width: calc(100% - 20px);
        flex: 1 1 calc(50% - 20px); /* 2 cards per row */
        max-width: none;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .event-card {
        padding: 6px 10px;
        min-width: 100%;
        flex: 1 1 100%; /* 1 card per row */
        max-width: 100%;
        border-radius: 6px;
    }
}

/* Large screens (1200px and above) */
@media (min-width: 1200px) {
    .event-card {
        flex: 1 1 calc(25% - 20px); /* 4 cards per row */
        max-width: 280px;
    }
}


.timer-card {
    border-radius: 20px;
    text-align: center;
    padding: 10px 15px;
    min-width: min(200px, calc(100% - 20px));
    flex: 1 1 200px;
    max-width: 300px;
    color: white;
    border: 2px solid #06AB78;
    background: rgba(40, 167, 69, 0.05);
}

.event-card h4 {
    margin: 5px 0;
    font-size: clamp(14px, 2vw, 16px);
}

.event-card span {
    display: block;
    font-size: clamp(12px, 1.5vw, 14px);
    color: #aaa;
}

.event-card button {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: clamp(12px, 1.5vw, 14px);
    background-color: #06AB78;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.event-card button:hover {
    background-color: #059267;
}

.event-card.selected {
    border: 2px solid #06AB78;
}

.event-card-reset {
    display: inline;
}

.event-card-reset button {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: clamp(12px, 1.5vw, 14px);
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.event-card-reset button:hover {
    background-color: #da190b;
}

.timer-frame-all-timers {
    flex: 1 1 100px;
    max-width: 200px;
    min-width: min(200px, calc(100% - 20px));
    padding: clamp(15px, 3vw, 30px);
    border: 2px solid #494b49;
    border-radius: 20px;
    background: #222;
    text-align: center;
}

.timer-frame-all-timers.selected {
    border: 3px solid #06AB78;
    background: #2a2a2a;
    transform: scale(1.05);
    transition: all 0.2s ease-in-out;
}

/* Page content */
.page-container {
    /*padding: clamp(10px, 2vw, 16px);*/
}

.create-btn {
    padding: 12px;
    font-size: clamp(14px, 2vw, 16px);
    border-radius: 8px;
    background-color: #06AB78;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.create-btn:hover {
    background-color: #059267;
}

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
    background-color: white;
    font-family: 'JetBrains Mono', monospace;
    padding: 20px;
}

.auth-card {
    background-color: #30313D;
    padding: clamp(24px, 4vw, 40px) clamp(20px, 3vw, 32px);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    text-align: left;
}

.auth-title {
    color: #06AB78;
    font-size: clamp(20px, 4vw, 28px);
    margin-bottom: clamp(16px, 3vw, 24px);
    text-align: center;
}

.auth-field {
    margin-bottom: clamp(15px, 2vw, 20px);
}

.auth-label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: #ddd;
    font-size: clamp(13px, 2vw, 15px);
}

.auth-note {
    font-size: clamp(11px, 1.5vw, 12px);
    color: #aaa;
    display: block;
    margin-bottom: 4px;
}

.auth-input {
    width: 100%;
    padding: clamp(10px, 1.5vw, 12px) clamp(12px, 2vw, 14px);
    border: 1px solid #555;
    border-radius: 6px;
    background-color: white;
    color: #30313D;
    font-size: clamp(13px, 2vw, 14px);
}

.auth-input:focus {
    border-color: #06AB78;
    outline: none;
}

.auth-actions {
    margin-top: clamp(15px, 2vw, 20px);
}

.auth-btn {
    width: 100%;
    padding: clamp(10px, 1.5vw, 12px);
    background-color: #06AB78;
    color: white;
    font-size: clamp(14px, 2vw, 16px);
    font-weight: bold;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.auth-btn:hover {
    background-color: #059267;
}

.auth-links {
    margin-top: 16px;
    font-size: clamp(12px, 2vw, 14px);
    text-align: center;
}

.auth-links a {
    color: #06AB78;
    text-decoration: none;
    margin: 0 6px;
}

.auth-links a:hover {
    text-decoration: underline;
}

.add-timer-form {
    margin-top: clamp(20px, 3vw, 30px);
    text-align: center;
    background-color: rgba(40, 167, 69, 0.05);
    padding: clamp(15px, 2vw, 20px);
    border-radius: 20px;
    border: #06AB78 2px solid;
}

/* Mobile-specific responsive adjustments */
@media (max-width: 768px) {
    .timer-frame, .timer-frame-show {
        width: calc(100% - 20px);
        margin: 10px;
    }

    .timers-row {
        flex-direction: column;
        align-items: center;
    }

    .event-card, .timer-card, .timer-frame-all-timers {
        width: 100%;
        max-width: none;
        margin: 5px 0;
    }

    .button {
        padding: 10px 20px;
        margin: 3px;
    }

    .dropdown-menu {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 90vw;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .timer-display-show {
        padding: 15px 20px;
    }

    .auth-card {
        margin: 10px;
        width: calc(100% - 20px);
    }
}

/* Landscape mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .auth-page {
        min-height: auto;
        padding: 10px;
    }

    .timer-display-show {
        font-size: clamp(60px, 15vw, 180px);
        padding: 15px 30px;
    }
}

/* Tablet responsive */
@media (min-width: 481px) and (max-width: 768px) {
    .timers-row {
        justify-content: space-evenly;
    }

    .event-card, .timer-card {
        flex: 0 1 calc(50% - 20px);
    }
}

/* Large screens */
@media (min-width: 1440px) {
    .timer-frame {
        max-width: 1200px;
    }

    .timer-frame-show {
        max-width: 1400px;
    }

    .timers-row {
        max-width: 1400px;
        margin: 0 auto;
    }
}


/* Progress Bar Styles for Viewer */
.progress-container {
    width: 100%;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    margin: 20px auto;
    max-width: 90%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(to right,
    #ef5350 0%,
    #ef5350 10%,
    #ffa726 10%,
    #ffa726 33%,
    #4caf50 33%,
    #4caf50 100%);
}

.progress-mask {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: #757575;
    border-radius: 20px 0 0 20px;
    width: 0%;
    transition: width 1s linear;
}

.progress-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%);
    animation: shimmer 2s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-container.critical {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Ensure the progress bar is visible in the broadcast timer frame */
.broadcast-timer-frame .progress-container {
    margin-top: 30px;
}