/* RESET / BASE STYLES */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Cairo", Arial, sans-serif; /* Consistent font across the page */
}

/* PAGE BACKGROUND */
body {
    background-color: #f3f3f3; /* Light gray to let gold/teal stand out */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.nav-menu {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    background-color: #007bff; /* Blue background */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

    .nav-menu:hover {
        background-color: #0056b3; /* Darker blue on hover */
}

    .nav-menu img {
        width: 24px;
        height: 24px;
}
/* MAIN WRAPPER (CARD) */
.card {
    background-color: #fff;
    width: 320px; /* Typical mobile-friendly width */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* HEADER WITH LOGO */
.header {
    background-color: #222; /* Near-black header */
    padding: 1rem;
    border-bottom: 2px solid #b99d75; /* Gold border */
    text-align: center;
}

/* Logo image at 25% width */
.header img {
    width: 40%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* CONTENT AREA */
.content {
    background-color: #f5f5f5;
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.content.hidden {
    display: none;
}

/* LOGIN FORM CONTAINER */
.login-form {
    background-color: #fff;
    padding: 1rem;
    margin: 0 auto;
    border-radius: 8px;
    width: 280px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* FORM HEADING */
.login-form h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: normal;
    font-size: 1.1rem;
    color: #333;
}

/* FORM GROUPS (LABEL + INPUT) */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border-radius: 4px;
    border: 2px solid #b99d75; /* Gold border from the logo color */
    font-size: 0.9rem;
    outline: none;
    transition: box-shadow 0.3s;
}

.form-group input:focus {
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.5); /* Gold glow on focus */
}

/* LOGIN BUTTON */
.login-btn {
    width: 100%;
    padding: 0.6rem;
    border-radius: 4px;
    border: 2px solid #b99d75; /* Gold border */
    background-color: #a9eff7; /* Teal/blue from logo’s crescent */
    color: #b99d75; /* White text for contrast */
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.login-btn:hover {
    background-color: #486b81; /* Slightly darker teal on hover */
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

/* SIGN OUT BUTTON */
.sign-out-btn {
    width: 100%;
    padding: 0.6rem;
    border-radius: 4px;
    border: 2px solid #b99d75; /* Gold border */
    /*background-color: #a9eff7; /* Teal/blue color similar to login button */
    color: #b99d75; /* Text color matching the border */
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.sign-out-btn:hover {
    background-color: #486b81; /* Slightly darker teal on hover */
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

/* REGISTER BUTTON (inverted colors) */
.register-btn {
    width: 100%;
    padding: 0.6rem;
    border-radius: 4px;
    /* Swap the gold and teal from the login button */
    border: 2px solid #a9eff7; /* Teal border */
    background-color: #fff;  /* Gold background */
    color: #a9eff7;            /* Teal text */
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    margin-top: 0.5rem; /* Optional spacing between buttons */
}

.register-btn:hover {
    /* Darken the gold or choose another suitable hover color */
    background-color: #9e875f; 
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.change_action {
    margin-top: 12px;
    background: transparent;
    border: none;
    text-decoration: underline;
}

.form-group select {
    width: 100%;
    padding: 0.6rem;
    border-radius: 4px;
    border: 2px solid #b99d75;
    background-color: #fff;
    color: #333;
    font-size: 0.9rem;
    outline: none;
    margin-bottom: 0.5rem;
    cursor: pointer; /* Optional, so user sees pointer on hover */
}

.error-text {
    color: red;
    font-weight: bold;
    margin-bottom: 10px;
}
/* FOOTER */
.footer {
    background-color: #222; /* Match header background for continuity */
    padding: 1rem;
    border-top: 2px solid #b99d75; /* Gold border */
}

.info {
    font-size: 0.8rem;
    line-height: 1.2;
    text-align: center;
    color: #b99d75; /* White text against dark footer */
    border-top: 1.5px solid #b99d75; /* Upper golden border */
    padding-top: 10px; /* Add some spacing between the border and the content */    
}
.notice {
    margin-top: 0px;
    text-align: center;
    color: #b99d75;
    font-size: 0.8rem;
    line-height: 1.4;
}

.error-text {
    display: block;
    margin-top: 4px;
    color: #dd2c00;
    font-size: 12px;
}

/* ALERT */
#alert {
    position: fixed;
    top: 20px;
    background: #dd2c00;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    max-width: 320px;
    min-height: 32px;
    padding: 0 20px;
    border-radius: 8px;
    opacity: 0;
    color: white;
    visibility: hidden;
    transform: translateY(-100%);
    transition: all 0.3s ease-out;
}

#alert.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* TIME BOX */
.time-box {
    background-color: #fff;
    padding: 1rem 2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* TABS */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.tab-button {
    background-color: #ddd;
    border: 1px solid #b99d75;
    outline: none;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px 8px 0 0;
    font-size: 1rem;
    transition: background-color 0.5s;
}

.tab-button:hover {
    background-color: #ccc;
}

.tab-button.active {
    background-color: #fff;
    border-bottom: 3px solid #fff; /* Align tab with content */
}

/* TAB CONTENT */
.tab-content {
    display: none; /* Hidden by default */
    text-align: center;
}

.tab-content.active {
    display: block; /* Display active tab */
}

/* ON/OFF BUTTONS */
.circle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: silver;
    /*border: 3px solid #b99d75;*/
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem;
    transition: box-shadow 0.5s;
}

.circle-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}
.circle-btn:hover {
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

.on-btn:not(.disabled) {
    background-color: #28a745; /* Green */
}

.off-btn:not(.disabled) {
    background-color: #dc3545; /* Red */
}

/* SPINNER */
.spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
}

.sand-clock {
    position: relative;
    width: 50px;
    height: 150px;
    border: 5px solid #b99d75;
    border-radius: 50%;
    animation: rotate 1.5s infinite linear;
}

.sand-clock:before,
.sand-clock:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background: #b99d75;
    border-radius: 50%;
    animation: drop 1.5s infinite linear;
}

.sand-clock:before {
    top: 5%;
    left: 50%;
    transform: translate(-50%, 0);
}

.sand-clock:after {
    bottom: 5%;
    left: 50%;
    transform: translate(-50%, 0);
}

        /* Popup styling */
        .popup-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }

        .popup {
            background: white;
            width: 300px;
            padding: 20px;
            border-radius: 8px;
            text-align: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }

        .popup h2 {
            margin-bottom: 15px;
            font-size: 1.2rem;
        }

        .popup-timer {
            font-size: 1.5rem;
            font-weight: bold;
            margin: 20px 0;
            color: #dc3545; /* Red for emphasis */
        }

        .popup-buttons {
            display: flex;
            justify-content: center;
            gap: 10px;
        }

        .popup-buttons button {
            padding: 10px 15px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: bold;
            transition: background-color 0.3s;
        }

        .popup-buttons .confirm-btn {
            background: #28a745; /* Green */
            color: white;
        }

        .popup-buttons .cancel-btn {
            background: #dc3545; /* Red */
            color: white;
        }

        .popup-buttons button:hover {
            opacity: 0.9;
        }


@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

/* RESPONSIVE BUTTON ADJUSTMENTS */
@media (min-width: 340px) {
    .circle-btn {
        width: 80px;
        height: 80px;
        font-size: 1rem;
    }
}
