* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden;
    min-height: 0;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

.menu-container {
    flex: 1;
    display: flex;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}

.column {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    position: relative;
}

.column.animating {
    overflow: visible;
}

/* Hide scrollbar but keep functionality */
.column::-webkit-scrollbar {
    display: none;
}

.column {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.item {
    padding: 8px;
    background: #f0f0f0;
    border-radius: 6px;
    text-align: center;
    font-size: clamp(12px, 2.5vh, 20px);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    min-height: 0;
    position: relative;
}

.item:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

/* Animation classes for menu transitions */
.item.slide-to-right {
    animation: slideToRight var(--animation-duration, 0.5s) ease-out;
    position: relative;
    z-index: 1000;
}

.item.slide-to-left {
    animation: slideToLeft var(--animation-duration, 0.5s) ease-out;
    position: relative;
    z-index: 1000;
}

.item.fade-out {
    animation: fadeOut var(--animation-duration, 0.5s) ease-out forwards;
}

.item.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes slideToRight {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(calc(100% + 10px), var(--vertical-offset, 0));
        opacity: 1;
    }
}

@keyframes slideToLeft {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-100% - 10px), var(--vertical-offset, 0));
        opacity: 1;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.text-area-container {
    background: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.text-area {
    width: 100%;
    height: clamp(60px, 10vh, 80px);
    padding: 8px;
    font-size: clamp(14px, 2vh, 18px);
    border: 2px solid #667eea;
    border-radius: 6px;
    resize: none;
    font-family: Arial, sans-serif;
}

.instructions {
    background: rgba(255,255,255,0.95);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-size: clamp(11px, 1.8vh, 14px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.instructions strong {
    color: #667eea;
}

.special-item {
    background: #ffe8e8;
    color: #cc0000;
    font-size: clamp(11px, 2vh, 16px);
}

.suggestion-item {
    background: #e8f8e8;
    color: #006600;
    font-size: clamp(11px, 2vh, 16px);
}

.search-result-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    text-align: left;
    min-height: 70px;
}

.search-result-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.search-result-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.search-result-title {
    font-weight: bold;
    font-size: clamp(11px, 1.8vh, 14px);
    color: #1a0dab;
    line-height: 1.3;
}

.search-result-snippet {
    font-size: clamp(10px, 1.5vh, 12px);
    color: #545454;
    line-height: 1.4;
    font-weight: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.custom-item {
    background: #e8e8ff;
    color: #0000cc;
    font-size: clamp(11px, 2vh, 16px);
}

.mode-indicator {
    background: rgba(255,255,255,0.95);
    padding: 6px;
    border-radius: 6px;
    text-align: center;
    font-size: clamp(12px, 2vh, 16px);
    font-weight: bold;
    color: #667eea;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.mode-indicator.special {
    color: #cc0000;
    background: #ffe8e8;
}

.mode-indicator.suggestions {
    color: #006600;
    background: #e8f8e8;
}

.mode-indicator.custom {
    color: #0000cc;
    background: #e8e8ff;
}

.gaze-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.95);
    padding: 10px 15px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    font-size: 14px;
    z-index: 1000;
}

.gaze-indicator.active {
    background: #e8f8e8;
    border: 2px solid #006600;
}

.gaze-indicator.error {
    background: #ffe8e8;
    border: 2px solid #cc0000;
}

.calibration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.calibration-message {
    color: white;
    font-size: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.calibration-dot {
    width: 30px;
    height: 30px;
    background: #667eea;
    border-radius: 50%;
    border: 3px solid white;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.video-preview {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: min(200px, 30vw);
    height: min(150px, 22.5vw);
    max-width: 200px;
    max-height: 150px;
    border: 2px solid white;
    border-radius: 8px;
    z-index: 1000;
    display: none;
    transform: scaleX(-1);
}

.eye-visualization {
    position: fixed;
    bottom: 10px;
    right: min(220px, calc(30vw + 20px));
    width: min(400px, 60vw);
    height: min(200px, 30vw);
    max-width: 400px;
    max-height: 200px;
    border: 2px solid white;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    transform: scaleX(-1);
}

.gaze-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    background: rgba(102, 126, 234, 0.7);
    border: 2px solid white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    display: none;
    transition: all 0.1s ease;
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
    .video-preview {
        width: 25vw;
        height: 18.75vw;
        max-width: 150px;
        max-height: 112px;
        bottom: 5px;
        right: 5px;
    }

    .eye-visualization {
        width: 50vw;
        height: 25vw;
        max-width: 300px;
        max-height: 150px;
        right: calc(25vw + 10px);
        bottom: 5px;
    }
}

@media screen and (max-width: 480px) {
    .video-preview {
        width: 30vw;
        height: 22.5vw;
        max-width: 120px;
        max-height: 90px;
    }

    .eye-visualization {
        width: 60vw;
        height: 30vw;
        max-width: 250px;
        max-height: 125px;
        right: calc(30vw + 10px);
    }
}

/* Result Viewer */
.result-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.result-viewer-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.result-viewer-title {
    font-size: 18px;
    font-weight: bold;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-viewer-back {
    font-size: 14px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    margin-left: 20px;
}

.result-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: white;
    scroll-behavior: smooth;
}
