/**
 * Mt Ivy Car Wash Self Serve System - Main Stylesheet
 * Mobile-first responsive design for outdoor/bright light use
 */

/* ========================================
   RESET & BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #222;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

h1 {
    font-size: 32px;
    margin-bottom: 20px;
    text-align: center;
    color: #222;
}

h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

p {
    margin-bottom: 15px;
}

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.section {
    margin-bottom: 30px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-block;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 15px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #04AA6D;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #039657;
}

.btn-secondary {
    background-color: #008CBA;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #007399;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #da190b;
}

.btn-large {
    font-size: 24px;
    padding: 20px 40px;
    min-height: 80px;
}

/* Arrow buttons for number input */
.btn-arrow {
    width: 120px;
    height: 120px;
    font-size: 48px;
    background-color: #04AA6D;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-arrow:active {
    background-color: #039657;
}

/* Navigation buttons (Logout, Back to Device, My Account) */
.nav-buttons {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
    width: 100%;
}

.btn-nav {
    flex: 1;
    display: inline-block;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-nav:hover {
    background: #667eea;
    color: white;
}

.btn-nav:active {
    transform: scale(0.98);
}

/* ========================================
   FORMS & INPUTS
   ======================================== */

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 18px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"] {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #04AA6D;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Password field with toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    flex: 1;
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 16px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #333;
}

/* ========================================
   TIMER DISPLAY
   ======================================== */

.timer {
    font-size: 72px;
    font-weight: bold;
    text-align: center;
    margin: 30px 0;
    color: #04AA6D;
    font-family: 'Courier New', monospace;
}

.timer.countdown {
    color: #008CBA;
}

/* ========================================
   DEVICE STATUS
   ======================================== */

.status {
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    font-size: 20px;
    margin-bottom: 20px;
}

.status-ready {
    background-color: #d4edda;
    color: #155724;
}

.status-running {
    background-color: #fff3cd;
    color: #856404;
}

.status-not-available {
    background-color: #f8d7da;
    color: #721c24;
}

/* ========================================
   DEVICE INFO
   ======================================== */

.device-info {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.device-info p {
    margin-bottom: 10px;
    font-size: 18px;
}

.device-info strong {
    color: #333;
}

/* ========================================
   POPUP FORM (Pre-Pay Time)
   ======================================== */

.form-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.form-popup-open {
    display: flex !important;
}

.form-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 15px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 3px solid white;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.form-container p {
    color: white;
    margin-bottom: 15px;
}

.number-input-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
}

.number-input {
    width: 180px !important;
    height: 180px !important;
    font-size: 120px !important;
    font-weight: bold;
    text-align: center;
    border: 4px solid #04AA6D !important;
    border-radius: 15px !important;
    line-height: 1.4;
    padding: 0 !important;
    background-color: white;
}

.price-display {
    font-size: 36px;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    color: white;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
}

/* ========================================
   TRANSACTION HISTORY
   ======================================== */

.transaction {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 4px solid #04AA6D;
}

.transaction p {
    margin-bottom: 5px;
}

.transaction-id {
    font-size: 14px;
    color: #666;
}

/* ========================================
   PAYMENT METHODS
   ======================================== */

.card {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #008CBA;
}

.card.default {
    border-left-color: #04AA6D;
}

.card-info {
    flex: 1;
}

.card-brand {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 5px;
}

.card-number {
    color: #666;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
    min-height: auto;
    width: auto;
}

/* ========================================
   MESSAGES & ALERTS
   ======================================== */

.message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: bold;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
}

.message-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.message-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* ========================================
   RECEIPT DISPLAY
   ======================================== */

.receipt {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px solid #333;
}

.receipt h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #04AA6D;
}

/* ========================================
   TAP TO PAY BUTTON
   ======================================== */

.btn-tap-to-pay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #fff;
    color: #555;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 20px;
    border: 2px solid #ccc;
    border-radius: 5px;
    width: 100%;
}
.btn-tap-to-pay:hover { background-color: #f5f5f5; border-color: #999; color: #333; }
.btn-tap-to-pay svg { width: 20px; height: 20px; opacity: 0.7; }
.tap-to-pay-divider {
    margin: 0 6px;
    opacity: 0.4;
    font-weight: normal;
}

/* ========================================
   HIDDEN UTILITY
   ======================================== */

.hidden {
    display: none !important;
}

/* ========================================
   LOADING OVERLAY
   ======================================== */

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    color: white;
    font-size: 20px;
    text-align: center;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 480px) {
    body {
        padding: 10px;
        font-size: 16px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 22px;
    }

    .btn {
        font-size: 18px;
        padding: 12px 25px;
    }

    .btn-large {
        font-size: 20px;
        padding: 18px 35px;
        min-height: 70px;
    }

    .timer {
        font-size: 56px;
    }

    .btn-arrow {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }

    .number-input {
        width: 120px !important;
        height: 120px !important;
        font-size: 72px !important;
        padding: 0 !important;
    }

    .price-display {
        font-size: 30px;
    }

    /* Account page specific mobile styles */
    .card {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .card-info {
        margin-bottom: 15px;
    }

    .card-brand {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .card-number {
        font-size: 18px;
    }

    .card-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .btn-small {
        width: 100%;
        font-size: 16px;
        padding: 12px 15px;
    }

    .transaction {
        padding: 15px;
        font-size: 16px;
    }

    .transaction p {
        font-size: 16px;
        line-height: 1.5;
        margin-bottom: 8px;
    }

    .transaction-id {
        font-size: 13px !important;
    }

    #profileInfo p {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 12px;
        word-break: break-word;
    }
}

/* ========================================
   LANGUAGE TOGGLE
   ======================================== */

.btn-lang {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    z-index: 100;
}

.btn-lang:hover {
    background: #667eea;
    color: white;
}

.container {
    position: relative;
    padding-top: 50px;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 15px 0;
}

.page-btn {
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 44px;
}

.page-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.page-btn.active {
    background: #667eea;
    color: white;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 10px 8px;
    color: #666;
    font-weight: bold;
}

.page-info {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

@media (max-width: 480px) {
    .page-btn {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 40px;
    }
}

/* Pulsing animation for stop button */
@keyframes pulse-danger {
    0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(244, 67, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
}

.btn-danger-pulse {
    animation: pulse-danger 2s infinite;
}
