/**
 * BistroBot Main Styles
 * Base styles, CSS variables, and general layout
 */

/* CSS Variables for 5-Section Static Layout */
:root {
    /* Legacy variables for backward compatibility */
    --conversation-widget-height: 70vh;  /* Updated: Widget now takes 70% of viewport */
    --conversation-ptt-height: 9vh;     /* PTT button takes 9% of viewport */
    --conversation-buffer-height: 6vh;  /* Buffer/footer takes 6% of viewport */
    --ptt-internal-padding: 20px;       /* Internal padding for PTT button */

    /* New 5-section layout variables - reordered for better mobile UX */
    --layout-header-height: 5vh;        /* Header section: 5% of viewport */
    --layout-widget-height: 65vh;       /* Widget section: 65% of viewport (reduced from 70) */
    --layout-prompt-height: 8vh;        /* Prompt suggestion section: 8% (increased from 5) */
    --layout-ptt-height: 10vh;          /* PTT button section: 10% of viewport (increased from 9) */
    --layout-footer-height: 7vh;        /* Footer section: 7% of viewport (increased from 6) */
    --layout-internal-padding: 20px;    /* Internal padding for all sections */

    /* Color System - Quick Wins Enhancement */
    --color-primary: #4F7BF7;           /* Primary blue */
    --color-primary-dark: #3b5fd6;      /* Darker blue for hover states */
    --color-secondary: #7B68EE;         /* Purple accent */
    --color-success: #10B981;           /* Green for success states */
    --color-error: #EF4444;             /* Red for errors */
    --color-warning: #F59E0B;           /* Orange for warnings */
    --color-text-primary: #1F2937;      /* Dark gray for primary text */
    --color-text-secondary: #6B7280;    /* Medium gray for secondary text */
    --color-text-light: #9CA3AF;        /* Light gray for tertiary text */
    --color-background: #F8FAFC;        /* Light background */
    --color-surface: #FFFFFF;           /* White for cards/surfaces */

    /* Spacing System */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius System */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-pill: 9999px;

    /* Shadow System */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 15px 60px rgba(0, 0, 0, 0.18), 0 6px 20px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Enable smooth scrolling */
}

body {
    font-family: Inter, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
    color: #333;
    transition: all 0.3s ease-in-out;
}

/* Logo and icon sizing */
.logo {
    height: 64px; /* 20% smaller than original 80px */
    margin-bottom: 20px;
}

.cognibistro-header-logo {
    height: 77px;
    width: auto;
    flex-shrink: 0;
    filter: brightness(0) invert(1); /* Makes the logo white on gradient header */
}

/* Header with logo and title */
.header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    margin-top: 0;
    padding: 20px 20px 15px 20px; /* Reduced padding for slimmer header */
    background: linear-gradient(135deg, #4F7BF7 0%, #7B68EE 100%);
    width: 100%;
    position: relative;
    box-sizing: border-box;
    justify-content: space-between; /* Three-column layout */
}

.header-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto; /* Don't grow or shrink */
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1; /* Take up available space and center content */
}

.header-right {
    display: flex;
    align-items: center;
    flex: 0 0 auto; /* Don't grow or shrink */
}

.title {
    font-family: 'Orbitron', monospace, -apple-system, "system-ui", sans-serif;
    font-size: 2.2rem; /* Reduced from 2.5rem */
    font-weight: 700;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px; /* Adds tech/futuristic spacing */
    margin: 0;
    flex-grow: 0; /* Don't grow to fill space */
    background: none !important;
    -webkit-text-fill-color: white !important;
}

.header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Widget area */
#widget-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
}

/* Footer styles */
.footer {
    margin-top: 75px;  /* Fixed margin for better visibility */
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    padding: 30px 20px;
    background: linear-gradient(135deg, #4F7BF7 0%, #7B68EE 100%);
    width: 100%;
    position: relative;
    box-sizing: border-box;
    z-index: 1;  /* Low but positive z-index to maintain proper positioning */
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Trenta logo section - displayed in normal mode only */
.trenta-logo-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
    transition: all 0.3s ease;
}

.trenta-logo-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.trenta-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.trenta-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.trenta-info .powered-by {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

.trenta-info .restaurant-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* Trenta logo section */
.trenta-logo-section {
    text-align: center;
    padding: 5px; /* Reduced from 20px to minimize spacing */
    margin: 5px auto; /* Reduced from 20px to minimize spacing */
    max-width: 800px;
}

/* Trenta bottom logo sizing */
.trenta-bottom-logo {
    height: 180px; /* 3x bigger - was 60px, now 180px */
    max-width: 600px; /* 3x bigger - was 200px, now 600px */
    object-fit: contain;
}

/* Simple guidance */
.simple-guidance {
    text-align: center;
    padding: 15px 20px;
    margin: 10px auto;
    max-width: 600px;
}

.simple-guidance p {
    color: #475569;
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.6;
}

/* Highlight text */
.highlight-text {
    color: #2563eb;
    font-weight: 600;
    font-size: 1.2em; /* 20% bigger than normal text */
    background: linear-gradient(120deg, #3b82f6, #1d4ed8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Simple guidance message */
.guidance-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    z-index: 50;
}

.guidance-message h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.guidance-message p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.guidance-message .start-hint {
    font-size: 1rem;
    color: #999;
    font-style: italic;
}

/* Phone icon for call button */
.phone-icon {
    display: inline-block;
    width: 1.3em; /* 30% bigger than 1em */
    height: 1.3em; /* 30% bigger than 1em */
    margin: 0 2px;
    vertical-align: -0.1em;
    fill: currentColor;
}

/* Animated prompt suggestion (between header and widget) */
.single-prompt-suggestion {
    border-radius: 8px;
    padding: 8px 18px;
    margin: 2px auto;  /* Normal margin for standalone position */
    max-width: 600px;
    text-align: center;
    font-size: 0.9rem;
    color: #757575;  /* Original gray color for white background */
    cursor: pointer;
    transition: color 0.2s ease;
}

.single-prompt-suggestion:hover {
    color: #505050;  /* Darker gray on hover */
}

.single-prompt-suggestion.copied {
    background-color: transparent;
    color: #4CAF50;
    border-color: #28a745;
}

/* Environment badge for non-production */
.env-badge {
    position: fixed;
    top: 10px;
    left: 10%;
    background: #ff6b6b;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10000;
    text-transform: uppercase;
}

.env-badge.staging {
    background: #f59e0b;
}

.env-badge.development {
    background: #10b981;
}

.env-badge.preview {
    background: #8b5cf6;
}

/* Android-specific positioning to avoid header bar conflict */
.android-app .env-badge {
    top: calc(var(--android-header-height) + var(--android-header-margin)); /* Position below header + margin */
    right: var(--android-header-margin);
    z-index: 10001; /* Higher than Android header elements */
}

/* Responsive styles */
@media (max-width: 768px) {
    .header p {
        font-size: 1rem;
    }
    
    .guidance-message {
        padding: 20px;
        max-width: 90%;
    }
    
    .guidance-message h2 {
        font-size: 1.5rem;
    }
    
    .guidance-message p {
        font-size: 1rem;
    }
    
    /* Mobile logo sizing */
    .trenta-title-svg {
        height: 40px; /* Even smaller on mobile */
    }
    
    .bistrobot-logo {
        height: 43px; /* 80% bigger: 24 * 1.8 ≈ 43px */
    }
    
    .logo {
        height: 60px;
        margin-bottom: 15px;
    }
    
    /* Mobile conversation mode adjustments (exclude Android) */
    body.conversation-mode:not(.conversation-fixed-layout) {
        .trenta-title-svg {
            height: 24px; /* Even smaller for mobile conversation mode */
        }

        .bistrobot-logo {
            height: 36px; /* 80% bigger: 20 * 1.8 = 36px */
        }
    }
    
    /* Mobile simple guidance */
    .simple-guidance {
        padding: 12px 15px;
        margin: 8px auto;
    }
    
    .simple-guidance p {
        font-size: 1rem;
    }
    
    /* Mobile prompt suggestion (exclude Android) */
    body.conversation-mode:not(.conversation-fixed-layout) {
        .single-prompt-suggestion {
            font-size: 0.8rem; /* Even smaller font on mobile */
            padding: 5px 12px; /* Tighter padding */
            margin: 6px auto; /* Reduced margin */
            max-width: 90%; /* Use more screen width on mobile */
        }
    }
    
    /* Mobile Trenta logo section */
    .trenta-logo-section {
        padding: 3px; /* Reduced from 15px */
        margin: 3px auto; /* Reduced from 15px */
    }
    
    /* Mobile Trenta bottom logo */
    .trenta-bottom-logo {
        height: 150px; /* 3x bigger - was 50px, now 150px */
        max-width: 450px; /* 3x bigger - was 150px, now 450px */
    }
}

@media (max-width: 480px) {
    .trenta-logo-container {
        bottom: 10px;
        right: 10px;
        padding: 10px;
    }
    
    .trenta-logo {
        width: 40px;
        height: 40px;
    }
    
    .trenta-info .restaurant-name {
        font-size: 1rem;
    }
    
    .simple-guidance {
        padding: 8px 10px;
        margin: 5px auto;
    }
    
    .simple-guidance p {
        font-size: 0.9rem;
    }
    
    /* Ultra-small screens conversation mode (exclude Android) */
    body.conversation-mode:not(.conversation-fixed-layout) {
        .single-prompt-suggestion {
            font-size: 0.75rem; /* Ultra-small font */
            padding: 4px 10px; /* Minimal padding */
            margin: 4px auto; /* Minimal margin */
        }
    }
    
    .trenta-logo-section {
        padding: 2px; /* Reduced from 10px */
        margin: 2px auto; /* Reduced from 10px */
    }
    
    .trenta-bottom-logo {
        height: 120px; /* 3x bigger - was 40px, now 120px */
        max-width: 360px; /* 3x bigger - was 120px, now 360px */
    }
}