:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background: var(--bg-gradient);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    color: var(--text-main);
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- Layout Reset --- */
#wrapper {
    display: block !important;
    overflow: visible !important;
}

#sidebar-wrapper,
.top-navbar {
    display: none !important;
}

#page-content-wrapper {
    margin: 0 !important;
    width: 100% !important;
    background: transparent !important;
}

/* --- Main Container --- */
.kiosk-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Background Overlay Pattern */
.kiosk-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(255, 255, 255, 0.03) 0px, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* --- Header --- */
.kiosk-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.kiosk-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.kiosk-subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    font-weight: 300;
}

/* --- Grid --- */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    padding: 1rem;
    perspective: 1000px;
}

/* iPad Landscape Optimization */
/* iPad Landscape Optimization */
@media (min-width: 1024px) {
    .kiosk-wrapper {
        padding: 1rem 3rem;
        /* Widen horizontal padding, shrink vertical */
        justify-content: center;
    }

    .kiosk-header {
        margin-bottom: 2rem;
        /* Reduce header space */
    }

    .user-grid {
        grid-template-columns: repeat(5, 1fr);
        /* 5 columns for wider view */
        gap: 1.5rem;
        /* Tighter gap */
        max-width: 1300px;
    }

    .user-card {
        padding: 2rem 1rem;
        /* Compact card padding */
    }

    .avatar-wrapper {
        width: 90px;
        height: 90px;
        margin-bottom: 1rem;
    }

    .user-name {
        font-size: 1.15rem;
    }

    /* iPad Landscape PIN Modal Optimization */
    .kiosk-modal-width {
        max-width: 480px;
        /* Wider modal for tablet */
    }

    .pin-grid {
        max-width: 380px;
        /* Wider grid */
        gap: 2rem;
        /* More spacing */
    }

    .pin-btn {
        width: 85px;
        /* Larger buttons */
        height: 85px;
        font-size: 2rem;
    }
}

/* Default Modal Width */
.kiosk-modal-width {
    max-width: 400px;
    margin: 0 auto;
}

@media (min-width: 1024px) and (max-width: 1100px) {
    .user-grid {
        grid-template-columns: repeat(4, 1fr);
        /* Back to 4 if 5 is too crowded */
    }
}

/* --- User Card --- */
.user-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s backwards;
}

.user-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--card-hover-shadow);
}

.user-card:active {
    transform: scale(0.95);
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.user-card:hover::before {
    opacity: 1;
}

.avatar-wrapper {
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
    position: relative;
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.user-card:hover .avatar-wrapper img {
    transform: scale(1.1);
}

.user-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.85rem;
    padding: 0.4em 1em;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Staggered Animation Delays */
.user-card:nth-child(1) {
    animation-delay: 0.1s;
}

.user-card:nth-child(2) {
    animation-delay: 0.15s;
}

.user-card:nth-child(3) {
    animation-delay: 0.2s;
}

.user-card:nth-child(4) {
    animation-delay: 0.25s;
}

.user-card:nth-child(5) {
    animation-delay: 0.3s;
}

.user-card:nth-child(6) {
    animation-delay: 0.35s;
}

.user-card:nth-child(7) {
    animation-delay: 0.4s;
}

.user-card:nth-child(8) {
    animation-delay: 0.45s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- PIN Modal Customization --- */
.modal-content.glass-modal {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.pin-pad-container {
    padding: 1rem;
    text-align: center;
}

.pin-display {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.pin-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all 0.2s ease;
}

.pin-dot.filled {
    background: #6366f1;
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.pin-dot.error {
    background: #ef4444;
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

.pin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 320px;
    margin: 0 auto;
}

.pin-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: white;
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--text-main);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.pin-btn:active {
    transform: scale(0.9);
    background: #f1f5f9;
}

.pin-btn.primary {
    color: #6366f1;
}

.pin-btn.backspace {
    color: #64748b;
    font-size: 1.5rem;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .kiosk-wrapper {
        padding: 1rem;
    }

    .kiosk-title {
        font-size: 1.8rem;
    }

    .user-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .user-card {
        padding: 1.5rem 1rem;
    }

    .avatar-wrapper {
        width: 80px;
        height: 80px;
    }

    .pin-btn {
        width: 65px;
        height: 65px;
        font-size: 1.5rem;
    }
}