/* style.css */
:root {
    --bg-color: #0f172a;
    --primary: #8b5cf6;
    --secondary: #ec4899;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', sans-serif;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
    color: var(--text-main);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    height: 100%;
    padding: 24px;
    animation: fadeIn 0.4s ease forwards;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Screen */
.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    font-size: 15px;
    color: var(--text-sub);
    margin-bottom: 48px;
    text-align: center;
}

.pin-dots {
    display: flex;
    gap: 20px;
    margin-bottom: 64px;
}

.dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.2s ease;
}

.dot.filled {
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 300px;
}

.numpad button {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-main);
    font-size: 26px;
    font-weight: 600;
    padding: 22px 0;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.1s ease;
}

.numpad button:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.15);
}

.numpad button.empty {
    visibility: hidden;
}

.numpad button.delete {
    font-size: 22px;
    background: transparent;
    border: none;
    backdrop-filter: none;
}

/* Main Screen */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 24px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--glass-bg);
    padding: 8px 16px 8px 8px;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.user-name {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.admin-badge {
    background: var(--secondary);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 6px;
    font-weight: bold;
    text-transform: uppercase;
}

.btn-edit {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.btn-edit:hover {
    color: var(--secondary);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-title {
    font-size: 15px;
    color: var(--text-sub);
    margin-bottom: 12px;
    font-weight: 500;
}

.card-value {
    font-size: 36px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

/* Toast Message */
.toast {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
    backdrop-filter: blur(5px);
}

.toast.show {
    top: 40px;
}

/* Modal Popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 40px 24px;
    width: 90%;
    max-width: 340px;
    text-align: center;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.modal::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 60%);
    z-index: -1;
}

.modal-overlay.show .modal {
    transform: translateY(0) scale(1);
}

.modal-icon {
    font-size: 56px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.2));
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.modal-desc {
    font-size: 15px;
    color: var(--text-sub);
    margin-bottom: 28px;
    line-height: 1.6;
}

.coin-highlight {
    color: #fbbf24;
    font-weight: 700;
    font-size: 18px;
    margin-top: 10px;
    display: inline-block;
    background: rgba(251, 191, 36, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 18px;
    width: 100%;
    margin-top: 32px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-sub);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    text-align: left;
}

.form-group label {
    font-size: 13px;
    color: var(--text-main);
}

.form-group input, .form-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    font-family: inherit;
    width: 100%;
}

.form-group input:focus, .form-input:focus {
    border-color: var(--secondary);
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}

.btn-sm {
    padding: 12px;
    font-size: 14px;
    margin-top: 12px;
    border-radius: 10px;
}

/* Loader */
.loader-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loader-container.show {
    display: flex;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .3s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary);
}
input:checked + .slider:before {
    transform: translateX(22px);
}

.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.icon-btn:hover {
    background: rgba(255,255,255,0.15);
}
.content-delete-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}
.content-delete-btn:hover {
    background: rgba(255,255,255,0.15);
}
.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ticket-btn {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 12px;
    color: #78350f;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.ticket-btn:active {
    transform: scale(0.9);
}
.ticket-btn.opened {
    background: #334155;
    color: white;
    cursor: default;
    box-shadow: none;
    pointer-events: none;
}

.list-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}
.list-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.list-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}
.list-item-date {
    font-size: 11px;
    color: var(--text-sub);
}
