* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0F2854; /* Dark blue background */
    min-height: 100vh;
    color: #BDE8F5; /* Light blue text */
    overflow-x: hidden;
    user-select: none;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: #0F2854;
    color: #BDE8F5;
    font-size: 14px;
    font-weight: 500;
}

.status-icons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(12px, 3vw, 18px) clamp(15px, 4vw, 25px);
    background: #1C4D8D;
    border-bottom: 3px solid #4988C4;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right {
    display: flex;
    align-items: center;
}

.app-title {
    font-size: clamp(18px, 5vw, 24px);
    font-weight: 700;
    color: #BDE8F5;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff0909;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
    text-decoration: none;
}

.logout-btn:hover {
    color: #ff4444;
    transform: scale(1.1);
}

/* Area Select Dropdown */
.area-select {
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 20px);
    background: #1C4D8D;
    border: 2px solid #4988C4;
    border-radius: 8px;
    color: #BDE8F5;
    font-size: clamp(14px, 3.5vw, 18px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23BDE8F5' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
    min-width: 140px;
}

.area-select:hover {
    border-color: #BDE8F5;
    background-color: #4988C4;
}

.area-select:focus {
    outline: none;
    border-color: #BDE8F5;
    box-shadow: 0 0 0 3px rgba(189, 232, 245, 0.2);
}

.area-select option {
    background: #1C4D8D;
    color: #BDE8F5;
    padding: 10px;
}

/* Vehicle Display */
.vehicle-display-container {
    padding: clamp(10px, 3vw, 20px);
    background: #0F2854;
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
}

.input-group {
    flex: 1;
    min-width: 0; /* Allow flex items to shrink below their content size */
}

.input-label {
    display: block;
    color: #BDE8F5;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
    margin-bottom: 6px;
    text-align: center;
}

.vehicle-display {
    width: 100%;
    padding: clamp(12px, 3.5vw, 20px);
    background: #1C4D8D;
    border: 2px solid #4988C4;
    border-radius: 10px;
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 700;
    color: #BDE8F5;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: clamp(2px, 0.8vw, 4px);
}

.vehicle-display-letters {
    text-transform: uppercase;
}

.vehicle-display-numbers {
    text-transform: none;
}

.vehicle-display::placeholder {
    color: #4988C4;
    opacity: 0.6;
    font-size: clamp(14px, 4vw, 20px);
}

/* Message */
.message {
    margin: 10px 20px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
    transition: opacity 0.3s ease;
}

.message.success {
    background: #1b5e20;
    color: #81c784;
    border: 1px solid #4caf50;
}

.message.error {
    background: #b71c1c;
    color: #ef5350;
    border: 1px solid #f44336;
}

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

/* Tabs */
.tabs {
    display: flex;
    padding: 0 clamp(10px, 3vw, 20px);
    gap: 0;
    margin-top: 10px;
}

.tab-btn {
    flex: 1;
    padding: clamp(12px, 3vw, 15px);
    background: #1C4D8D;
    border: 2px solid #4988C4;
    color: #BDE8F5;
    font-size: clamp(14px, 4vw, 18px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0;
    min-height: 44px; /* Minimum touch target */
}

.tab-btn:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-right: none;
}

.tab-btn:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-left: none;
}

.tab-btn.active {
    background: #4988C4;
    color: #FFFDE1;
    border-color: #4988C4;
}

.tab-btn:active {
    transform: scale(0.98);
}

/* Keyboard Container */
.keyboard-container {
    padding: 10px;
    background: #0F2854;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.keyboard-section {
    width: 100%;
}

.keyboard-label {
    color: #BDE8F5;
    font-size: clamp(14px, 3.5vw, 16px);
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    padding: 8px;
    background: #1C4D8D;
    border-radius: 8px;
    border: 1px solid #4988C4;
}

.keyboard {
    display: block;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

/* Ensure delete button maintains proper size */
.delete-btn {
    min-width: calc((100% - 50px) / 6);
    max-width: 60px;
    width: calc((100% - 50px) / 6);
}

.key-btn {
    /* Flexible sizing: works from 320px and scales up */
    min-width: calc((100% - 60px) / 6); /* 6 buttons per row with gaps */
    max-width: 60px;
    width: calc((100% - 60px) / 6);
    aspect-ratio: 1;
    height: auto;
    min-height: 40px;
    background: #1C4D8D;
    border: 2px solid #4988C4;
    border-radius: 8px;
    color: #BDE8F5;
    font-size: clamp(14px, 4vw, 20px); /* Responsive font size */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
}

.key-btn:active {
    background: #4988C4;
    color: #FFFDE1;
    transform: scale(0.95);
}

.delete-btn {
    background: #f44336;
    border-color: #f44336;
    color: white;
    font-size: 24px;
}

.delete-btn:active {
    background: #d32f2f;
    transform: scale(0.95);
}

/* Vehicle Type Selection */
.vehicle-type-container {
    display: flex;
    gap: clamp(10px, 3vw, 20px);
    padding: clamp(20px, 4vw, 30px);
    justify-content: center;
    background: #0F2854;
}

.vehicle-type-btn {
    width: clamp(90px, 25vw, 120px);
    background: #4988C4;
    border: 3px solid #4988C4;
    border-radius: 12px;
    color: #FFFDE1;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 2.5vw, 15px);
}

.vehicle-icon {
    width: clamp(40px, 12vw, 50px);
    height: clamp(40px, 12vw, 50px);
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.vehicle-type-btn:active {
    background: #1C4D8D;
    color: #BDE8F5;
    transform: scale(0.95);
}

.vehicle-type-btn.active {
    background: #1C4D8D;
    color: #BDE8F5;
    border-color: #4988C4;
}

.vehicle-type-btn.active .vehicle-icon {
    filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(200deg);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: clamp(6px, 2vw, 10px);
    padding: clamp(12px, 3vw, 20px);
    background: #0F2854;
    position: sticky;
    bottom: 0;
}

.action-btn {
    flex: 1;
    padding: clamp(12px, 3vw, 18px);
    border: none;
    border-radius: 10px;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    min-height: 44px; /* Minimum touch target size */
}

.in-btn {
    background: #1C4D8D;
    color: #BDE8F5;
    border: 2px solid #4988C4;
}

.in-btn:active {
    background: #4988C4;
    color: #FFFDE1;
    transform: scale(0.98);
}

.exit-btn {
    background: #1C4D8D;
    color: #BDE8F5;
    border: 2px solid #4988C4;
}

.exit-btn:active {
    background: #4988C4;
    transform: scale(0.98);
}

.list-btn {
    background: #1C4D8D;
    color: #BDE8F5;
    border: 2px solid #4988C4;
}

.list-btn:active {
    background: #4988C4;
    transform: scale(0.98);
}

/* View Vehicles Page Styles */
.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.card {
    background: #0F2854;
    border-radius: 0;
    padding: 20px;
    min-height: 100vh;
}

h1 {
    font-size: 24px;
    color: #BDE8F5;
    margin-bottom: 10px;
    text-align: center;
}

h2 {
    font-size: 18px;
    color: #BDE8F5;
    margin-bottom: 20px;
    text-align: center;
    font-weight: normal;
}

.vehicles-list {
    margin-top: 20px;
}

.count-badge {
    background: #1C4D8D;
    color: #BDE8F5;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 16px;
    border: 2px solid #4988C4;
}

.vehicle-card {
    background: #1C4D8D;
    border: 2px solid #4988C4;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.vehicle-card:hover {
    border-color: #4988C4;
    box-shadow: 0 5px 15px rgba(100, 181, 246, 0.2);
}

.vehicle-info {
    flex: 1;
}

.vehicle-number {
    font-size: 24px;
    font-weight: 700;
    color: #BDE8F5;
    margin-bottom: 8px;
}

.vehicle-time {
    font-size: 14px;
    color: #90caf9;
    margin-bottom: 5px;
}

.vehicle-area {
    font-size: 13px;
    color: #BDE8F5;
    margin-bottom: 5px;
    font-weight: 500;
}

.vehicle-duration {
    font-size: 13px;
    color: #90caf9;
    font-weight: 500;
}

.checkout-form {
    margin-left: 15px;
}

.btn-secondary {
    background: #f44336;
    color: white;
    padding: 12px 24px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #90caf9;
    font-size: 18px;
}

.links {
    margin-top: 20px;
    text-align: center;
}

.link-btn {
    display: inline-block;
    padding: 12px 25px;
    background: #1C4D8D;
    color: #BDE8F5;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid #4988C4;
}

.link-btn:hover {
    background: #4988C4;
    color: #FFFDE1;
    transform: translateY(-2px);
}

/* Responsive design from 320px and up */
@media (min-width: 320px) {
    .keyboard-container {
        padding: 8px;
        gap: 15px;
    }
    
    .keyboard-row {
        gap: 5px;
        margin-bottom: 6px;
    }
    
    .key-btn {
        min-width: calc((100% - 50px) / 6);
        max-width: 50px;
        width: calc((100% - 50px) / 6);
        min-height: 38px;
        font-size: clamp(12px, 3.5vw, 18px);
    }
    
    .vehicle-display {
        padding: 12px;
        font-size: clamp(20px, 5vw, 28px);
        letter-spacing: 2px;
    }
    
    .vehicle-display::placeholder {
        font-size: clamp(18px, 4vw, 20px);
    }
    
    .vehicle-type-btn {
        width: clamp(50px, 25vw, 100px);
    }
    
    .action-btn {
        padding: clamp(12px, 3vw, 18px);
        font-size: clamp(16px, 4vw, 20px);
    }
    
    .header {
        padding: 10px 12px;
    }
    
    .app-title {
        font-size: clamp(16px, 4vw, 22px);
    }
    
    .logout-btn {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .area-select {
        min-width: 120px;
        font-size: clamp(12px, 3vw, 16px);
        padding: 8px 35px 8px 10px;
    }
    
    .vehicle-display-container {
        padding: 15px;
    }
    
    .vehicle-type-container {
        padding: 15px;
        gap: 10px;
    }
    
    .action-buttons {
        padding: 15px;
        gap: 8px;
    }
}

@media (min-width: 375px) {
    .keyboard-container {
        padding: 12px;
        gap: 18px;
    }
    
    .keyboard-row {
        gap: 7px;
        margin-bottom: 8px;
    }
    
    .key-btn {
        min-width: calc((100% - 56px) / 6);
        max-width: 55px;
        width: calc((100% - 56px) / 6);
        min-height: 42px;
    }
}

@media (min-width: 414px) {
    .keyboard-container {
        padding: 15px;
        gap: 20px;
    }
    
    .keyboard-row {
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .key-btn {
        min-width: calc((100% - 64px) / 6);
        max-width: 58px;
        width: calc((100% - 64px) / 6);
        min-height: 45px;
    }
}

@media (min-width: 480px) {
    .keyboard-container {
        padding: 20px;
    }
    
    .keyboard-row {
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .key-btn {
        min-width: calc((100% - 80px) / 6);
        max-width: 60px;
        width: calc((100% - 80px) / 6);
        min-height: 50px;
        font-size: 20px;
    }
    
    .vehicle-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .checkout-form {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
    }
    
    .btn-secondary {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .key-btn {
        max-width: 70px;
        min-height: 60px;
        font-size: 24px;
    }
    
    .keyboard-row {
        gap: 12px;
    }
}
