* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-bottom: revert;
    padding-top: revert;
}

.container {
   background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgb(0 0 0 / 32%);
    padding: 10px 50px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    backdrop-filter: blur(10px);
   
}
    
.logo {
    font-size: 3rem;
    margin-bottom: 5px;
    color: #667eea;
    text-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.room-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5rem;
    font-weight: 600;
}

.pin-page {
    display: block;
}

.unlock-page {
    display: none;
}

/* PIN Input Styles */
.pin-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    margin-top: 10px;
}

.pin-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: all 0.3s ease;
}

.pin-dot.filled {
    background: #667eea;
    transform: scale(1.2);
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.key {
    aspect-ratio: 1;
    border: none;
    border-radius: 50%;
    background: #f8f9fa;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 1px 3px 9px 0px rgb(0 0 0 / 32%);
    
}

.key:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.key:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.key.zero {
    grid-column: 2;
}

.clear-btn, .delete-btn {
    box-shadow: 1px 3px 3px rgb(0 0 0 / 32%);
    background: #ff6b6b;
    color: white;
    padding: 5px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s ease;
}

.clear-btn:hover, .delete-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.error-message {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

/* Unlock Page Styles */
.unlock-container {
    text-align: center;
}

/* Change PIN Page Styles */
.change-pin-page {
    display: none;
}

.step-indicator {
    margin-bottom: 15px;
}

.step-text {
    color: #667eea;
    font-size: 1rem;
    margin-bottom: 10px;
}

.change-pin-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    margin: 10px 5px;
    transition: all 0.3s ease;
}

.change-pin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.unlock-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    font-size: 3rem;
    cursor: pointer;
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.3);
    transition: all 0.1s ease;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.unlock-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 50px rgba(76, 175, 80, 0.4);
}

.unlock-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.unlock-btn.unlocking {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    box-shadow: 0 15px 40px rgba(255, 152, 0, 0.3);
}

.unlock-btn.success {
    background: linear-gradient(135deg, #4CAF50 0%, #2e7d32 100%);
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.5);
}

.unlock-btn.hold-to-unlock {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.unlock-btn.hold-to-unlock::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    transition: width 1s ease-out;
    border-radius: 50%;
}

.unlock-btn.hold-to-unlock.filling::before {
    width: 100%;
}

.unlock-btn .lock-icon {
    position: relative;
    z-index: 2;
    font-size: 4rem;
    transition: all 0.1s ease;
}

.unlock-btn.filling .lock-icon {
    animation: pulse 0.1s infinite alternate;
}

.unlock-btn.success .lock-icon {
    animation: unlockSuccess 0.1s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

@keyframes unlockSuccess {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.instruction-text {
    margin-top: 20px;
    color: #666;
    font-size: 1rem;
    opacity: 0.8;
}

.status-message {
    margin: 20px 0;
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
}

.status-message.show {
    opacity: 1;
}

.status-message.success {
    color: #4CAF50;
}

.status-message.processing {
    color: #ff9800;
}

.back-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 7px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.unlock-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #4CAF50;
}

@media (max-width: 480px) {
    .container {
        padding: 10px 20px;
        margin: 10px;
        margin-top: -30px;
        max-width: 85%;
        height: fit-content;
    }

    .keypad {
        gap: 10px;
        margin-bottom: 10px;
    }
    h1 {
        margin-bottom: 5px;
    }

    .key {
        font-size: 1.3rem;
    }
}

 /* Prevent zooming when pressing the button */
* {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent text selection */
html, body, button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent screen scrolling */
html, body {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Customize the buttons */
.key, .delete-btn, .clear-btn, .change-pin-btn, .back-btn, .unlock-btn {
    cursor: pointer;
    min-height: 44px; /* Recommended minimum size for touch screen buttons */
    font-size: 1.2rem;
    touch-action: manipulation;
}

html, body, .container, .pin-page, .unlock-page, .change-pin-page {
    background-color: #FFFFFF !important;
}


