/**
 * CmdWord Zoo - Main App Styles
 * Child-friendly design matching Python/pygame version
 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F0F8FF; /* Light blue - matches Python version */
    color: #323232; /* Dark gray */
    overflow: hidden; /* Fullscreen feel */
    height: 100vh;
    overflow-anchor: none; /* Prevent scroll anchoring */
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid #ddd;
}

.header-left .title {
    font-size: 48px;
    font-weight: bold;
    color: #0064C8;
    margin: 0;
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-name {
    font-size: 18px;
    color: #666;
}

.btn-admin,
.btn-logout {
    padding: 10px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-admin:hover {
    background: #0064C8;
    color: white;
    border-color: #0064C8;
}

.btn-logout:hover {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

/* Content area */
.content {
    display: flex;
    flex: 1;
    padding: 40px;
    gap: 40px;
    overflow: hidden;
}

/* Word list (two columns) */
.word-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 400px;
    align-content: start;
    overflow-y: auto;
}

.word-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.word-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    font-size: 24px; /* Matches Python SMALL_FONT: 32px */
    color: #969696; /* Gray for word list - matches Python LIST_COLOR */
    transition: all 0.3s ease;
    pointer-events: none; /* Prevent interaction/focus */
    user-select: none; /* Prevent text selection */
}

.word-item.highlighted {
    background: rgba(0, 150, 0, 0.2); /* Green highlight */
    color: #009600; /* Bright green - matches Python HIGHLIGHT_COLOR */
    font-weight: bold;
    /* Removed transform: scale(1.05) to prevent scroll jumping */
}

.word-icon {
    font-size: 32px;
    line-height: 1;
}

/* Center image display */
.image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.image-wrapper {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 15px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.placeholder {
    text-align: center;
    color: #ccc;
}

.placeholder-icon {
    font-size: 120px;
    margin-bottom: 20px;
}

.placeholder p {
    font-size: 24px;
    color: #999;
}

/* Input footer */
.input-footer {
    padding: 30px 40px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 2px solid #ddd;
}

.input-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

/* Hidden input for mobile keyboard */
.hidden-input {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 60px;
    opacity: 0;
    pointer-events: none;
    font-size: 24px;
    border: none;
    background: transparent;
    color: transparent;
    direction: ltr;
    text-align: left;
    z-index: -1;
    padding: 10px;
}

.input-display {
    background: white;
    border: 3px solid #0064C8; /* Blue border - matches Python INPUT_COLOR */
    border-radius: 15px;
    padding: 20px 40px;
    min-width: 400px;
    text-align: center;
    font-size: 64px; /* Large font - matches Python INPUT_FONT: 72px */
    font-weight: bold;
    color: #0064C8; /* Blue text */
    font-family: monospace;
    position: relative;
    cursor: text;
    -webkit-tap-highlight-color: rgba(0, 100, 200, 0.2);
    user-select: none;
    -webkit-user-select: none;
    direction: ltr;
    unicode-bidi: bidi-override;
}

#inputText {
    display: inline;
    direction: ltr;
    unicode-bidi: embed;
}

.cursor {
    display: inline-block;
    margin-left: 0;
    animation: blink 1s step-end infinite;
    color: transparent;
    -webkit-text-stroke: 2px #0064C8;
    text-stroke: 2px #0064C8;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.input-help {
    text-align: center;
    font-size: 16px;
    color: #999;
}

/* Scrollbar styling */
.word-list::-webkit-scrollbar {
    width: 8px;
}

.word-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.word-list::-webkit-scrollbar-thumb {
    background: rgba(0, 100, 200, 0.3);
    border-radius: 10px;
}

.word-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 100, 200, 0.5);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .content {
        flex-direction: column;
    }

    .word-list {
        width: 100%;
        grid-template-columns: repeat(3, 1fr);
        max-height: 200px;
    }

    .image-container {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }

    .header-left .title {
        font-size: 32px;
    }

    .word-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .word-item {
        font-size: 18px;
        padding: 8px 12px;
    }

    .input-display {
        font-size: 48px;
        min-width: 300px;
        padding: 15px 30px;
    }
}
