:root {
    --primary-bg: #f0f4f8;
    --card-bg: #ffffff;
    --text-color: #333;
    --day-color: #3498db;
    --night-color: #2c3e50;
    --accent: #e74c3c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-color);
    height: 100vh;
    height: 100dvh;
    overflow: hidden; /* Prevent scrolling on main body */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Utilities */
.hidden {
    display: none !important;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

/* Login */
.login-box {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    width: 80%;
    max-width: 300px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.login-box h2 {
    color: var(--day-color);
    margin-bottom: 1rem;
}

.login-box input {
    font-size: 2rem;
    width: 100%;
    text-align: center;
    padding: 10px;
    margin: 1rem 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    letter-spacing: 5px;
}

.login-box button {
    background: var(--day-color);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}

.error-msg {
    color: var(--accent);
    margin-top: 10px;
    font-size: 0.9rem;
    min-height: 1.2em;
}

/* Main App */
#app-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

header {
    padding: 1rem;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

header h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

#logout-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
}

main {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

.pass-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid transparent;
}

.pass-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.day-pass {
    border-color: rgba(52, 152, 219, 0.2);
}

.day-pass .icon {
    color: var(--day-color);
}

.night-pass {
    border-color: rgba(44, 62, 80, 0.2);
}

.night-pass .icon {
    color: var(--night-color);
}

.icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.pass-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.count {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.action-text {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

footer {
    padding: 1rem;
    text-align: center;
    color: #888;
    font-size: 0.8rem;
}

/* PDF Viewer */
.pdf-container {
    width: 95%;
    height: 90%;
    background: white;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdf-header {
    padding: 1rem;
    background: #333;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: #555;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

#pdf-frame {
    flex: 1;
    border: none;
    width: 100%;
}

.pdf-footer {
    padding: 1rem;
    background: white;
    border-top: 1px solid #eee;
}

.action-btn {
    width: 100%;
    padding: 15px;
    background: var(--day-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
}
