/**
 * Kiosk Mode Styles for Resto M2
 * TV screen display and slideshow styles
 */

/* Kiosk Container */
.resto-m2-kiosk-container {
    /* Default styles for fullscreen */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    z-index: 999999;
    display: flex;
    flex-direction: column;
}

/* Embedded Mode */
.resto-m2-kiosk-container.kiosk-mode-embedded {
    position: relative;
    width: 100%;
    height: 600px; /* Fixed height for embedded */
    min-height: 500px;
    z-index: 10; /* Lower z-index for embedded */
    border-radius: 12px; /* Nice rounded corners for embedded */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Fullscreen specific overrides */
.resto-m2-kiosk-container.kiosk-mode-fullscreen {
    position: fixed;
    z-index: 999999;
}

/* Kiosk Header */
.kiosk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 50px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 10;
}

.kiosk-header h1 {
    margin: 0;
    font-size: 3em;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kiosk-clock {
    font-size: 2.5em;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-variant-numeric: tabular-nums;
}

/* Kiosk Content */
.kiosk-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.kiosk-slides {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
}

.kiosk-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.kiosk-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    z-index: 5;
}

.kiosk-slide.prev {
    transform: translateX(-100%);
    visibility: hidden;
}

/* Slide Header */
.slide-header {
    text-align: center;
    margin-bottom: 40px;
}

.slide-header h2 {
    font-size: 2.8em;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Menu Items Grid */
.menu-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    flex: 1;
    align-content: start;
    max-height: 100%;
    overflow: hidden;
}

.menu-item-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.menu-item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.menu-item-card:hover::before {
    left: 100%;
}

.menu-item-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Item Image */
.item-image {
    width: 100%;
    height: 150px;
    border-radius: 15px;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.menu-item-card:hover .item-image {
    transform: scale(1.05);
}

.item-placeholder {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 3em;
    color: rgba(255, 255, 255, 0.3);
}

/* Item Details */
.item-details {
    text-align: center;
}

.item-name {
    font-size: 1.4em;
    font-weight: 600;
    margin: 0 0 10px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
}

.item-description {
    font-size: 0.95em;
    opacity: 0.9;
    margin: 0 0 15px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-price {
    font-size: 1.3em;
    font-weight: 700;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

/* Kiosk Controls */
.kiosk-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.resto-m2-kiosk-container:hover .kiosk-controls {
    opacity: 1;
}

.kiosk-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.kiosk-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.kiosk-controls button:active {
    transform: scale(0.95);
}

/* Progress Indicator */
.slide-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    transition: width 0.1s linear;
    border-radius: 2px;
}

/* Loading State */
.kiosk-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.5em;
}

.kiosk-loading::before {
    content: '';
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Transition Effects */
.transition-fade .kiosk-slide {
    transform: none;
    transition: opacity 0.8s ease;
}

.transition-fade .kiosk-slide.active {
    opacity: 1;
}

.transition-fade .kiosk-slide:not(.active) {
    opacity: 0;
}

.transition-zoom .kiosk-slide {
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-zoom .kiosk-slide.active {
    opacity: 1;
    transform: scale(1);
}

.transition-flip .kiosk-slide {
    transform: rotateY(90deg);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-flip .kiosk-slide.active {
    opacity: 1;
    transform: rotateY(0deg);
}

/* Dark Theme */
.kiosk-theme-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.kiosk-theme-dark .menu-item-card {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.kiosk-theme-dark .kiosk-header {
    background: rgba(0, 0, 0, 0.5);
}

/* Portrait Orientation */
.kiosk-orientation-portrait {
    flex-direction: column;
}

.kiosk-orientation-portrait .menu-items-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.kiosk-orientation-portrait .kiosk-header h1 {
    font-size: 2.5em;
}

.kiosk-orientation-portrait .kiosk-clock {
    font-size: 2em;
}

/* No Data State */
.kiosk-no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    opacity: 0.7;
}

.kiosk-no-data .icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.kiosk-no-data h3 {
    font-size: 2em;
    margin: 0 0 10px 0;
    font-weight: 300;
}

.kiosk-no-data p {
    font-size: 1.2em;
    margin: 0;
    opacity: 0.8;
}

/* Admin Styles */
.resto-m2-kiosk-admin {
    max-width: 1200px;
}

.kiosk-header {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.kiosk-preview,
.kiosk-qr {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kiosk-preview h3,
.kiosk-qr h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.preview-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #f9f9f9;
}

.preview-actions {
    display: flex;
    gap: 10px;
}

.qr-container {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 10px;
}

.kiosk-settings {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.settings-tabs .tab-nav {
    display: flex;
    border-bottom: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.settings-tabs .tab-button {
    background: none;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
}

.settings-tabs .tab-button:hover {
    background: #f0f0f0;
    color: #333;
}

.settings-tabs .tab-button.active {
    background: #fff;
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
}

.settings-tabs .tab-panel {
    display: none;
    padding: 30px;
}

.settings-tabs .tab-panel.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .menu-items-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .kiosk-header h1 {
        font-size: 2.5em;
    }
    
    .kiosk-clock {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .kiosk-header {
        flex-direction: column;
        text-align: center;
        padding: 20px 30px;
    }
    
    .kiosk-header h1 {
        font-size: 2em;
        margin-bottom: 10px;
    }
    
    .kiosk-clock {
        font-size: 1.5em;
    }
    
    .kiosk-content {
        padding: 20px;
    }
    
    .menu-items-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .menu-item-card {
        padding: 20px;
    }
    
    .slide-header h2 {
        font-size: 2em;
    }
    
    .kiosk-controls {
        bottom: 20px;
        padding: 10px 20px;
        gap: 15px;
    }
    
    .kiosk-controls button {
        padding: 10px 15px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .kiosk-header {
        padding: 15px 20px;
    }
    
    .kiosk-header h1 {
        font-size: 1.8em;
    }
    
    .kiosk-clock {
        font-size: 1.3em;
    }
    
    .kiosk-content {
        padding: 15px;
    }
    
    .menu-item-card {
        padding: 15px;
    }
    
    .item-image,
    .item-placeholder {
        height: 120px;
    }
    
    .item-name {
        font-size: 1.2em;
    }
    
    .item-description {
        font-size: 0.9em;
    }
    
    .item-price {
        font-size: 1.1em;
    }
}

/* Print Styles */
@media print {
    .kiosk-controls,
    .slide-progress {
        display: none;
    }
    
    .resto-m2-kiosk-container {
        position: static;
        height: auto;
        background: white;
        color: black;
    }
    
    .kiosk-header,
    .menu-item-card {
        background: white;
        color: black;
        border: 1px solid #ccc;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .menu-item-card {
        border-width: 2px;
        border-color: white;
    }
    
    .kiosk-controls button {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .kiosk-slide,
    .menu-item-card,
    .kiosk-controls button {
        transition: none;
    }
    
    .menu-item-card:hover {
        transform: none;
    }
    
    .kiosk-loading::before {
        animation: none;
    }
    
    .menu-item-card::before {
        display: none;
    }
}