/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --secondary-color: #f7931e;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Kiosk Container */
.kiosk-container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
}

/* Header */
.kiosk-header {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.kiosk-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

/* Voice Status Indicator */
.voice-status-container {
    display: flex;
    align-items: center;
}

.voice-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
}

.voice-status.listening {
    background: var(--success-color);
    animation: pulse 1.5s infinite;
}

/* Continuous listening mode - enhanced visual feedback */
.voice-status.listening.continuous {
    background: linear-gradient(45deg, var(--success-color), #66bb6a);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    animation: continuousPulse 2s infinite;
}

.voice-status.listening.continuous::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, var(--success-color), #66bb6a, var(--success-color));
    border-radius: 28px;
    z-index: -1;
    animation: continuousRing 3s linear infinite;
}

.voice-status.processing {
    background: var(--warning-color);
    animation: spin 1s linear infinite;
}

.voice-status.paused {
    background: var(--error-color);
    animation: pausedBlink 2s infinite;
}

.voice-status.ready {
    background: rgba(255, 255, 255, 0.3);
}

.mic-icon {
    font-size: 1.2rem;
}

.status-text {
    font-weight: 500;
    font-size: 0.9rem;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes continuousPulse {
    0% { opacity: 1; transform: scale(1); }
    25% { opacity: 0.8; transform: scale(1.03); }
    50% { opacity: 0.9; transform: scale(1.06); }
    75% { opacity: 0.8; transform: scale(1.03); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes continuousRing {
    0% { 
        background: linear-gradient(0deg, var(--success-color), #66bb6a, var(--success-color));
        opacity: 0.8;
    }
    25% { 
        background: linear-gradient(90deg, var(--success-color), #66bb6a, var(--success-color));
        opacity: 1;
    }
    50% { 
        background: linear-gradient(180deg, var(--success-color), #66bb6a, var(--success-color));
        opacity: 0.8;
    }
    75% { 
        background: linear-gradient(270deg, var(--success-color), #66bb6a, var(--success-color));
        opacity: 1;
    }
    100% { 
        background: linear-gradient(360deg, var(--success-color), #66bb6a, var(--success-color));
        opacity: 0.8;
    }
}

@keyframes pausedBlink {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Welcome Screen */
.welcome-screen {
    display: none;
    min-height: calc(100vh - 80px);
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 2rem;
}

.welcome-screen.active {
    display: flex;
}

.welcome-content {
    text-align: center;
    color: white;
    max-width: 600px;
}

.welcome-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.welcome-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.start-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 1.5rem 3rem;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.start-btn:active {
    transform: translateY(0);
}

.instructions {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

/* Main Interface */
.main-interface {
    display: none;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.main-interface.active {
    display: block;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Menu Section */
.menu-section {
    background: var(--bg-white);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.menu-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-light);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.menu-items-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.menu-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.menu-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.menu-item-image {
    width: 100%;
    height: 150px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.menu-item-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.menu-item-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.menu-item-price {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Cart Section */
.cart-section {
    background: var(--bg-white);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.order-cart h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.cart-items {
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.empty-cart {
    text-align: center;
    color: var(--text-light);
    padding: 2rem 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

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

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-customizations {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.cart-item-price {
    font-weight: 600;
    color: var(--primary-color);
}

.cart-item-actions {
    display: flex;
    gap: 0.5rem;
}

.cart-item-actions button {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.cart-summary {
    border-top: 2px solid var(--border-color);
    padding-top: 1rem;
}

.total-section {
    margin-bottom: 1rem;
}

.total-section div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.total {
    font-weight: 700;
    font-size: 1.1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
}

.cart-actions {
    display: flex;
    gap: 0.5rem;
}

.cart-actions button {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: #e55a2b;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* AI Suggestion Panel */
.ai-suggestion-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

/* Continuous listening mode indicator for AI panel */
.ai-suggestion-panel.continuous-mode {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    animation: continuousGlow 3s infinite;
}

.ai-suggestion-panel.continuous-mode::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    animation: continuousSweep 4s infinite;
}

@keyframes continuousGlow {
    0%, 100% { 
        background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 0 20px rgba(76, 175, 80, 0.3);
    }
    50% { 
        background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 0 30px rgba(76, 175, 80, 0.5);
    }
}

@keyframes continuousSweep {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100vw) rotate(45deg); }
}

.ai-suggestion-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.listen-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.listen-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.listen-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Pause button styling */
.listen-btn.pause-mode {
    background: var(--error-color);
    color: white;
}

.listen-btn.resume-mode {
    background: var(--success-color);
    color: white;
    animation: resumePulse 2s infinite;
}

@keyframes resumePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    max-width: 300px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .cart-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .kiosk-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .kiosk-header h1 {
        font-size: 1.5rem;
    }

    .welcome-content h2 {
        font-size: 2rem;
    }

    .main-interface {
        padding: 1rem;
    }

    .menu-items-display {
        grid-template-columns: 1fr;
    }

    .menu-categories {
        justify-content: center;
    }

    .category-btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }

    /* Voice status adjustments for mobile */
    .voice-status {
        padding: 0.4rem 0.8rem;
        gap: 0.3rem;
    }

    .mic-icon {
        font-size: 1rem;
    }

    .status-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .start-btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }

    .cart-actions {
        flex-direction: column;
    }

    .ai-suggestion-panel {
        padding: 1rem;
    }

    .listen-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .voice-status-container {
        width: 100%;
        justify-content: center;
    }
}

/* Additional accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .voice-status.listening,
    .voice-status.processing,
    .ai-suggestion-panel.continuous-mode {
        animation: none;
    }

    .voice-status.listening.continuous::before {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #ff4500;
        --success-color: #008000;
        --error-color: #dc143c;
        --border-color: #000000;
    }

    .voice-status {
        border: 2px solid currentColor;
    }
}