/**
 * Kiosk Mode Styling for Cosmik Voice Kiosk
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

.kiosk-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 1200px;
    height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kiosk-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.kiosk-header h1 {
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.kiosk-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 20px;
    padding: 30px;
    overflow: hidden;
}

/* Transcription Section - Row 1: Chat window */
.transcription-section {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow flex child to shrink */
}

.conversation-title {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
    padding: 0 5px;
}

/* Chat window - scrollable container */
.chat-window {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #e9ecef;
    flex: 1;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Chat message container */
.chat-message {
    display: flex;
    width: 100%;
}

/* User messages - right aligned */
.user-message {
    justify-content: flex-end;
}

/* AI messages - left aligned */
.ai-message {
    justify-content: flex-start;
}

/* Chat bubbles */
.chat-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 1em;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap; /* Preserve line breaks from joined history */
}

/* User bubble - right side, blue/purple */
.user-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px; /* Pointed corner on right */
}

/* AI bubble - left side, neutral/darker */
.ai-bubble {
    background: #2d3748;
    color: white;
    border-bottom-left-radius: 4px; /* Pointed corner on left */
}

/* Empty state styling */
.chat-bubble:empty::before {
    content: "Waiting for input...";
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.user-bubble:empty::before {
    color: rgba(255, 255, 255, 0.7);
}

/* Order Section - Row 2: Full width card */
.order-section {
    grid-column: 1;
    grid-row: 2;
    background: white;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    margin-top: 10px; /* Visual separation from conversation */
}

.order-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.order-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.order-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.order-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.item-customizations {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    margin-top: 5px;
    padding-left: 5px;
}

.item-instructions {
    font-size: 0.85em;
    color: #764ba2;
    margin-top: 5px;
    padding-left: 5px;
    font-weight: 500;
}

.custom-badge {
    background: #f5576c;
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
}

.order-item-name {
    font-weight: 600;
    color: #333;
}

.order-item-qty {
    color: #666;
    margin-left: 10px;
}

.order-item-price {
    color: #667eea;
    font-weight: 600;
}

.empty-order {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.order-total {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    border: 2px solid #667eea;
}

.finalize-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.3em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.finalize-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.finalize-btn:active:not(:disabled) {
    transform: translateY(0);
}

.finalize-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Voice Section - Row 3: Centered */
.voice-section {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.speak-button {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.speak-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.speak-button:active {
    transform: scale(0.95);
}

.speak-button.recording {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

.button-icon {
    font-size: 3em;
}

.button-text {
    font-size: 0.9em;
}

.recording-indicator {
    color: #f5576c;
    font-weight: 600;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse {
    width: 12px;
    height: 12px;
    background: #f5576c;
    border-radius: 50%;
    animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(245, 87, 108, 0.3);
    }
    50% {
        box-shadow: 0 15px 50px rgba(245, 87, 108, 0.6);
    }
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Responsive adjustments for tablet */
@media (max-width: 1024px) {
    .kiosk-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 15px;
        padding: 20px;
    }
    
    .transcription-section {
        grid-column: 1;
        grid-row: 1;
    }
    
    .chat-window {
        max-height: 300px;
        padding: 15px;
    }
    
    .chat-bubble {
        max-width: 80%;
        font-size: 0.95em;
    }
    
    .order-section {
        grid-column: 1;
        grid-row: 2;
        padding: 20px;
    }
    
    .voice-section {
        grid-column: 1;
        grid-row: 3;
    }
    
    .kiosk-header h1 {
        font-size: 2em;
    }
    
    .speak-button {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 768px) {
    .chat-window {
        max-height: 250px;
        padding: 12px;
        gap: 10px;
    }
    
    .chat-bubble {
        max-width: 85%;
        font-size: 0.9em;
        padding: 10px 14px;
    }
    
    .order-section {
        padding: 15px;
    }
    
    .speak-button {
        width: 140px;
        height: 140px;
    }
}

