:root {
    /* Colors */
    --primary: #4F46E5; /* Indigo 600 */
    --primary-hover: #4338CA;
    --bg: #F9FAFB; /* Gray 50 */
    --surface: #FFFFFF;
    --text-main: #111827; /* Gray 900 */
    --text-muted: #6B7280; /* Gray 500 */
    --border: #E5E7EB; /* Gray 200 */
    
    --tag-en-bg: #DBEAFE;
    --tag-en-text: #1E40AF;
    --tag-cz-bg: #FEF3C7;
    --tag-cz-text: #92400E;
    
    --success: #10B981;
    --error: #EF4444;

    /* Shadows & Radii */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
}

/* Header */
.main-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.back-link {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Skrýt odkaz Zpět, pokud je slovníček otevřen v modálním okně / iframe */
body.in-modal .back-link,
html.in-modal .back-link {
    display: none !important;
}

.word-count {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.tabs {
    display: flex;
    background: var(--surface);
    padding: 0.35rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Modules */
.module {
    display: none;
    animation: fadeIn 0.3s ease;
}

.module.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dictionary Search */
.search-container {
    margin-bottom: 2rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
}

#searchInput {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Results */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.word-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.word-text {
    font-size: 1.1rem;
    font-weight: 500;
}

.lang-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lang-tag.en {
    background: var(--tag-en-bg);
    color: var(--tag-en-text);
}

.lang-tag.cz {
    background: var(--tag-cz-bg);
    color: var(--tag-cz-text);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

/* Practice Module */
.practice-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    text-align: center;
}

.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.score-badge {
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.word-display {
    margin-bottom: 2rem;
}

.word-display .lang-tag {
    display: inline-block;
    margin-bottom: 0.5rem;
    background: var(--tag-en-bg);
    color: var(--tag-en-text);
}

.the-word {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.025em;
}

.answer-section {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

#answerInput {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}

#answerInput:focus {
    outline: none;
    border-color: var(--primary);
}

.primary-btn, .secondary-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.primary-btn:hover {
    background: var(--primary-hover);
}

.secondary-btn {
    background: var(--bg);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.secondary-btn:hover {
    background: #E5E7EB;
}

.feedback-msg {
    margin-top: 1rem;
    font-weight: 500;
    min-height: 24px;
}

.feedback-msg.correct {
    color: var(--success);
}

.feedback-msg.wrong {
    color: var(--error);
}

/* Setup Notice */
.setup-notice {
    background: var(--surface);
    padding: 3rem 2rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.notice-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.setup-notice h2 {
    margin-bottom: 1rem;
}

.setup-notice p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.status-msg {
    margin-top: 1rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
    .main-header {
        flex-direction: column;
    }
    
    .answer-section {
        flex-direction: column;
    }
    
    .the-word {
        font-size: 2rem;
    }
}

/* Utilities */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.hidden { display: none !important; }

/* Admin & Modal */
.admin-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.form-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-group input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}

.form-group label {
    width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.admin-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.btn-danger {
    background: var(--error);
    color: white;
    border: none;
    cursor: pointer;
}
.btn-danger:hover {
    background: #DC2626;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .back-link, .word-count {
        position: static;
        margin-bottom: 0.5rem;
    }
    .main-header {
        position: relative;
        gap: 0.75rem;
    }
    .header-top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
}
