/* ===== Customer App Variables ===== */
:root {
    --primary: #FF6B6B;
    --secondary: #FF8E53;
    --accent: #FFD93D;
    --success: #00C853;
    --warning: #FFB300;
    --danger: #FF5252;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --gray: #6c757d;
    --border: #e9ecef;
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.5;
    padding-bottom: 80px;
    overflow-x: hidden;
}

/* ===== Notification Banner ===== */
.notification-banner {
    position: fixed;
    top: -100px;
    left: 0;
    right: 0;
    background: var(--gradient);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transition: top 0.4s ease;
    box-shadow: var(--shadow-lg);
}

.notification-banner.show {
    top: 0;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 1.5rem;
    animation: bellRing 0.5s ease infinite;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
}

.notification-text {
    font-weight: 600;
    font-size: 0.95rem;
}

.notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
}

/* ===== Header ===== */
.app-header {
    background: white;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-refresh {
    background: var(--light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-refresh:active {
    transform: rotate(180deg);
    background: var(--border);
}

/* ===== Main Content ===== */
.app-content {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Active Order Card ===== */
.active-order-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.order-status-bar {
    padding: 20px;
    color: white;
    text-align: center;
}

.order-status-bar.cooking {
    background: var(--gradient);
}

.order-status-bar.ready {
    background: linear-gradient(135deg, #00C853, #69F0AE);
}

.order-status-bar.delivery {
    background: linear-gradient(135deg, #2196F3, #64B5F6);
}

.status-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.status-icon.cooking {
    animation: cooking 1s ease infinite;
}

@keyframes cooking {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.status-icon.ready {
    animation: bounce 0.6s ease infinite;
}

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

.status-icon.delivery {
    animation: drive 1s ease infinite;
}

@keyframes drive {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.status-text {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.status-subtext {
    font-size: 0.9rem;
    opacity: 0.9;
}

.order-info {
    padding: 20px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.order-id {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.order-type-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.order-type-badge.pickup {
    background: #e8f5e9;
    color: var(--success);
}

.order-type-badge.delivery {
    background: #e3f2fd;
    color: #1976d2;
}

.order-items-preview {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.order-progress {
    margin-top: 20px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15%;
    right: 15%;
    height: 3px;
    background: var(--border);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    flex: 1;
}

.step-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step-icon.active {
    background: var(--gradient);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.step-icon.completed {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 0.7rem;
    color: var(--gray);
    text-align: center;
}

.step-label.active {
    color: var(--primary);
    font-weight: 600;
}

.order-eta {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.eta-label {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eta-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

/* ===== No Active Order ===== */
.no-active-order {
    background: white;
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.no-order-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-order-text {
    color: var(--gray);
    margin-bottom: 20px;
}

.btn-order-now {
    display: inline-block;
    padding: 12px 30px;
    background: var(--gradient);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-order-now:active {
    transform: scale(0.95);
}

/* ===== Order History ===== */
.history-card {
    background: white;
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-card:active {
    transform: scale(0.98);
    background: var(--light);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.history-order-id {
    font-weight: 700;
    color: var(--dark);
}

.history-date {
    font-size: 0.8rem;
    color: var(--gray);
}

.history-items {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-total {
    font-weight: 700;
    color: var(--primary);
}

.history-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.history-status.completed {
    background: #e8f5e9;
    color: var(--success);
}

.no-history {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.no-history-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0 20px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.75rem;
    padding: 5px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bottom-nav .nav-item.active {
    color: var(--primary);
}

.bottom-nav .nav-icon {
    font-size: 1.4rem;
}

.bottom-nav .nav-label {
    font-weight: 500;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: white;
}

.modal-header h2 {
    font-size: 1.2rem;
}

.modal-close {
    background: var(--light);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

/* ===== Order Detail Modal ===== */
.detail-section {
    margin-bottom: 25px;
}

.detail-section-title {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.detail-items {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-item-qty {
    color: var(--primary);
    font-weight: 600;
}

.detail-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    padding-top: 15px;
    border-top: 2px solid var(--border);
    margin-top: 10px;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-info-row {
    display: flex;
    justify-content: space-between;
}

.detail-info-label {
    color: var(--gray);
}

/* ===== Settings Modal ===== */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.setting-info {
    flex: 1;
}

.setting-label {
    display: block;
    font-weight: 600;
    margin-bottom: 3px;
}

.setting-desc {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider {
    background: var(--gradient);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* ===== Buttons ===== */
.btn-primary {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-full {
    width: 100%;
}

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

.history-card {
    animation: fadeIn 0.3s ease forwards;
}

.history-card:nth-child(1) { animation-delay: 0.05s; }
.history-card:nth-child(2) { animation-delay: 0.1s; }
.history-card:nth-child(3) { animation-delay: 0.15s; }
.history-card:nth-child(4) { animation-delay: 0.2s; }
.history-card:nth-child(5) { animation-delay: 0.25s; }

/* ===== Safe Area for iOS ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }

    body {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* ===== Login Screen ===== */
.login-screen {
    position: fixed;
    inset: 0;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-container {
    background: white;
    padding: 40px 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    font-size: 4rem;
    margin-bottom: 10px;
}

.login-title {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.login-subtitle {
    color: var(--gray);
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.login-hint {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--gray);
}

/* ===== Header Right ===== */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.user-name {
    font-weight: 500;
    color: var(--gray);
}

.btn-logout {
    background: var(--light);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--border);
}

/* ===== Re-order Button ===== */
.btn-reorder {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reorder:active {
    transform: scale(0.95);
}

/* ===== Re-order Modal ===== */
.reorder-intro {
    color: var(--gray);
    margin-bottom: 20px;
}

.reorder-items {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.reorder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.reorder-item:last-child {
    border-bottom: none;
}

.reorder-item-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reorder-item-qty {
    color: var(--primary);
    font-weight: 600;
}

.reorder-item-price {
    color: var(--gray);
    font-size: 0.9rem;
}

.reorder-actions {
    display: flex;
    gap: 12px;
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-confirm-reorder {
    flex: 2;
    padding: 14px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

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