/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
}

/* Header Styles */
header {
    background: var(--surface-color);
    box-shadow: var(--shadow-md);
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
}

/* Main Container */
main {
    max-width: 1200px;
    margin: 0 auto;
}

/* Page System */
.pages {
    position: relative;
}

.page {
    display: none;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-in-out;
}

.page.is-active {
    display: block;
}

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

h2 {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

/* Container */
.container {
    max-width: 100%;
}

/* Form styles */
.form-inline {
    width: 100%;
}

/* Sentence styles */
.veta {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    font-size: 1.125rem;
    line-height: 1.8;
    transition: var(--transition);
    position: relative;
    margin-bottom: 1rem;
}

.veta:hover {
    border-color: var(--primary-color);
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.veta.correct {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.veta.incorrect {
    border-color: var(--error-color);
    background: #fef2f2;
}

/* Input Styles */
.nastred {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    min-width: 120px;
    text-align: center;
}

.nastred:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.1);
}

.nastred.correct {
    border-color: var(--success-color);
    background: #f0fdf4;
    color: var(--success-color);
}

.nastred.incorrect {
    border-color: var(--error-color);
    background: #fef2f2;
    color: var(--error-color);
}

/* Button Styles */
.checkbutton, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
    min-height: 48px;
    touch-action: manipulation;
    margin: 0.5rem;
    background: var(--primary-color);
    color: white;
}

.checkbutton {
    background: var(--success-color);
    font-size: 1.125rem;
    padding: 0.75rem 2rem;
}

.checkbutton:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.checkbutton:hover {
    background: #059669;
}

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

/* Quiz Questions Form Styles */
.quizQuestions {
    margin: 1rem 0;
    padding: 0.5rem;
    font-size: 1rem;
    width: 100%;
}

#cedulka1, #cedulka2, #cedulka3 {
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    margin-bottom: 1rem;
}

input[type="text"], select {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    margin-left: 0.5rem;
    transition: var(--transition);
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.1);
}

/* Results */
#vysledek {
    background: #f8fafc;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    font-size: 1.25rem;
    border: 2px solid var(--border-color);
    text-align: center;
}

.output2p {
    margin-bottom: 2rem;
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Utility classes to match existing HTML */
.row { 
    margin: 0.5rem 0; 
    display: block;
}

.col-12 { 
    width: 100%; 
}

.m-2 { 
    margin: 0.5rem; 
}

.d-inline { 
    display: inline; 
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .page {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .veta {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .nastred {
        min-width: 100px;
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
    
    .btn, .checkbutton {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
        width: 100%;
        margin: 0.25rem 0;
    }
    
    #cedulka1, #cedulka2, #cedulka3 {
        padding: 0.75rem;
    }
    
    input[type="text"], select {
        width: 100%;
        margin: 0.25rem 0;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 1rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .veta {
        padding: 0.75rem;
        font-size: 0.875rem;
        line-height: 1.6;
    }
    
    .nastred {
        min-width: 80px;
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    #cedulka1, #cedulka2, #cedulka3 {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .page {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn,
    .checkbutton {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible for Better Accessibility */
.btn:focus-visible,
.checkbutton:focus-visible,
.nastred:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}