/* TOILET WINDOW — Styles */

/* Screens */
.screen {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1;
    transition: opacity 0.3s;
}

.screen.active {
    display: flex;
}

/* --- IDLE --- */
#screen-idle {
    background: #0a0a0a;
    transition: background 0.5s;
}

/* Červený stav po STOP */
#screen-idle.post-stop {
    animation: closedPulse 1.2s ease-in-out infinite;
}

#screen-idle .status-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

#screen-idle.post-stop .status-icon {
    opacity: 1;
    animation: bounce 0.6s ease-in-out;
}

#screen-idle .status-label {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 900;
    color: #333;
    letter-spacing: 0.15em;
}

#screen-idle .status-sub {
    font-size: 1rem;
    color: #222;
    margin-top: 0.5rem;
    letter-spacing: 0.3em;
}

/* --- ACTIVE --- */
#screen-active {
    background: #001a00;
    animation: activePulse 2s ease-in-out infinite;
}

@keyframes activePulse {

    0%,
    100% {
        background: #001a00;
    }

    50% {
        background: #002200;
    }
}

#screen-active .status-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#screen-active .status-label {
    font-size: clamp(1.8rem, 6vw, 3.5rem);
    font-weight: 900;
    color: #00ff41;
    letter-spacing: 0.08em;
    text-shadow: 0 0 30px rgba(0, 255, 65, 0.5), 0 0 60px rgba(0, 255, 65, 0.2);
}

.blink {
    animation: blink 1s ease-in-out 3;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.countdown {
    font-size: clamp(4rem, 15vw, 10rem);
    font-weight: 900;
    color: #fff;
    font-variant-numeric: tabular-nums;
    margin: 1rem 0;
    letter-spacing: 0.05em;
}

.status-sub-active {
    font-size: clamp(0.8rem, 2.5vw, 1.2rem);
    color: #00ff41;
    letter-spacing: 0.25em;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Pulse ring behind icon */
.pulse-ring {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 3px solid rgba(0, 255, 65, 0.3);
    border-radius: 50%;
    animation: pulseRing 2s ease-out infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -80%);
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -80%) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -80%) scale(2.5);
        opacity: 0;
    }
}

/* --- WARNING --- */
#screen-warning {
    background: #1a0a00;
    animation: warningFlash 0.8s ease-in-out infinite;
}

@keyframes warningFlash {

    0%,
    100% {
        background: #1a0a00;
    }

    50% {
        background: #2a1000;
    }
}

#screen-warning .status-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.warning-text {
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 900;
    color: #ff6b00;
    letter-spacing: 0.08em;
    text-shadow: 0 0 30px rgba(255, 107, 0, 0.5);
}

.warning-countdown {
    color: #ff6b00 !important;
    text-shadow: 0 0 40px rgba(255, 107, 0, 0.4);
}

.status-sub-warning {
    font-size: clamp(0.8rem, 2.5vw, 1.2rem);
    color: #ff6b00;
    letter-spacing: 0.25em;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* --- CLOSED --- */
#screen-closed {
    background: #1a0000;
    animation: closedPulse 1.2s ease-in-out infinite;
    box-shadow: inset 0 0 200px rgba(255, 0, 0, 0.15);
}

@keyframes closedPulse {

    0%,
    100% {
        background: #1a0000;
        box-shadow: inset 0 0 200px rgba(255, 0, 0, 0.1);
    }

    50% {
        background: #2a0000;
        box-shadow: inset 0 0 300px rgba(255, 0, 0, 0.25);
    }
}

#screen-closed .status-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: bounce 0.6s ease-in-out;
}

.closed-label {
    font-size: clamp(1.8rem, 6vw, 3.5rem);
    font-weight: 900;
    color: #ff3b30;
    letter-spacing: 0.08em;
    text-shadow: 0 0 40px rgba(255, 59, 48, 0.7), 0 0 80px rgba(255, 59, 48, 0.4), 0 0 120px rgba(255, 59, 48, 0.2);
    animation: closedTextPulse 1.5s ease-in-out infinite;
}

@keyframes closedTextPulse {

    0%,
    100% {
        text-shadow: 0 0 40px rgba(255, 59, 48, 0.7), 0 0 80px rgba(255, 59, 48, 0.4);
    }

    50% {
        text-shadow: 0 0 60px rgba(255, 59, 48, 0.9), 0 0 120px rgba(255, 59, 48, 0.6), 0 0 200px rgba(255, 59, 48, 0.3);
    }
}

.closed-subtitle {
    font-size: clamp(0.9rem, 3vw, 1.4rem);
    color: #ff3b30;
    letter-spacing: 0.25em;
    opacity: 0.5;
    margin-top: 0.8rem;
    font-weight: 700;
}

.closed-next {
    font-size: clamp(1rem, 3vw, 1.6rem);
    color: #ff6b6b;
    margin-top: 2rem;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.closed-time {
    font-weight: 900;
    color: #fff;
}

/* --- QUICK MENU --- */
.quick-menu {
    position: fixed;
    right: 0.75rem;
    bottom: 4rem;
    width: min(280px, calc(100vw - 1.5rem));
    background: rgba(10, 12, 18, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 0.9rem;
    z-index: 110;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
}

.quick-menu-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
}

.quick-menu-mode {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: #98a5b3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quick-menu-section {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-menu-subtitle {
    margin-bottom: 0.55rem;
    font-size: 0.72rem;
    color: #98a5b3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quick-menu-link {
    width: 100%;
    display: block;
    margin-top: 0.45rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: #171c26;
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
}

.quick-menu-link:first-child {
    margin-top: 0;
}

.quick-menu-link:hover {
    background: #1d2431;
}

.quick-menu-link:disabled {
    opacity: 0.7;
    cursor: default;
}

.quick-menu-note {
    margin-top: 0.55rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #98a5b3;
}

.quick-shortcut {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    color: #d8e0e8;
}

.quick-shortcut span:first-child {
    display: inline-flex;
    min-width: 1.8rem;
    height: 1.8rem;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #111520;
    color: #00ff41;
    font-weight: 800;
}

/* --- DASHBOARD --- */
#screen-dashboard {
    background: #0a0c10;
    padding: 1rem;
}

.dashboard {
    width: 100%;
    max-width: 1100px;
    overflow-y: auto;
    max-height: 100vh;
    padding-bottom: 5rem;
}

.dash-toilet-hero {
    font-size: clamp(3rem, 8vw, 5rem);
    text-align: center;
    margin-bottom: 1.5rem;
    animation: heroFloat 3s ease-in-out infinite;
}

@keyframes heroFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.dash-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #1a1e28;
}

.dash-logo {
    font-size: 2rem;
}

.dash-title {
    font-size: clamp(0.9rem, 2.5vw, 1.3rem);
    font-weight: 700;
    color: #8899aa;
    letter-spacing: 0.1em;
}

.dash-columns {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.dash-col-metrics {
    flex: 1;
    min-width: 0;
}

.dash-col-satisfaction {
    width: 300px;
    flex-shrink: 0;
    background: #111520;
    border: 1px solid #1a1e28;
    border-radius: 16px;
    padding: 1.2rem 1rem;
}

.sat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #1a1e28;
}

.sat-icon {
    font-size: 1.2rem;
}

.sat-title {
    font-size: 0.6rem;
    font-weight: 700;
    color: #8899aa;
    letter-spacing: 0.1em;
}

.sat-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.sat-person {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    background: #0d1018;
    border: 1px solid #151a25;
}

.sat-avatar {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.sat-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ccc;
    min-width: 50px;
}

.sat-stars {
    font-size: 1.1rem;
    color: #2a2a2a;
    letter-spacing: 2px;
    flex: 1;
    text-align: right;
    white-space: nowrap;
}

/* Filled star color */
.star-filled {
    color: #ffd60a;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
}

.dash-card {
    background: #111520;
    border: 1px solid #1a1e28;
    border-radius: 16px;
    padding: 1.2rem 1rem;
    text-align: center;
    transition: transform 0.2s;
}

.dash-card-emoji {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.dash-card-value {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 900;
    color: #00ff41;
    font-variant-numeric: tabular-nums;
}

.dash-card-value.pop {
    animation: popValue 0.3s ease-out;
}

@keyframes popValue {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.dash-card-label {
    font-size: 0.65rem;
    color: #556677;
    letter-spacing: 0.12em;
    margin-top: 0.4rem;
    font-weight: 600;
}

/* Unscheduled visits - červená */
.dash-card:nth-child(2) .dash-card-value {
    color: #ff3b30;
}

/* Money saved - zlatá + glow */
.dash-card-money {
    border-color: rgba(255, 214, 10, 0.3);
    background: #151510;
}

.dash-card-money .dash-card-value {
    color: #ffd60a;
    text-shadow: 0 0 20px rgba(255, 214, 10, 0.4);
}

/* Avg duration - žlutá */
.dash-card:nth-child(5) .dash-card-value {
    color: #ffd60a;
}

/* Productivity - zelená */
.dash-card:nth-child(8) .dash-card-value {
    color: #30d158;
}

.dash-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #1a1e28;
    font-size: 0.75rem;
    color: #445566;
    letter-spacing: 0.12em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.dash-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff41;
    display: inline-block;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* --- CONTROLS --- */
.controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid #222;
    z-index: 100;
    justify-content: center;
}

.ctrl-btn {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.ctrl-btn:active {
    transform: scale(0.93);
}

.ctrl-start {
    background: #00ff41;
    color: #000;
}

.ctrl-stop {
    background: #ff3b30;
    color: #fff;
}

.ctrl-dash {
    background: #1a1e28;
    color: #8899aa;
}

.ctrl-hide {
    background: #111;
    color: #555;
}

.controls-toggle {
    position: fixed;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(17, 21, 32, 0.92);
    color: #fff;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 120;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    -webkit-tap-highlight-color: transparent;
}

.controls-toggle:hover {
    background: rgba(27, 34, 48, 0.96);
}

.hidden {
    display: none !important;
}

/* Responsive - mobil */
@media (max-width: 700px) {
    .dash-columns {
        flex-direction: column;
    }

    .dash-col-satisfaction {
        width: 100%;
    }

    .dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .controls {
        flex-wrap: wrap;
    }

    .ctrl-btn {
        flex: 1;
        min-width: 70px;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}