/* Jednotný styl pro všechny HTML soubory - Fyzika a chemie */

:root {
    --primary-color: #005A9C;
    --secondary-color: #00AEEF;
    --accent-color: #FDBB30;
    --bg-color: #f9f9f9;
    --text-color: #333;
    --header-color: #2c3e50;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --formula-bg: #fff3cd;
    --formula-border: #ffc107;
    --result-bg: #d4edda;
    --result-border: #28a745;
    --note-bg: #e8f4fd;
    --note-border: #2196f3;
}

/* Základní styly pro celou stránku */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

/* Hlavní kontejner pro obsah */
main {
    max-width: 1100px;
    margin: 20px auto;
    padding: 20px;
}

/* Styly pro hlavičku */
header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

header h1 {
    margin: 0;
    font-size: 2.8em;
    font-weight: 700;
}

header p {
    margin-top: 10px;
    font-size: 1.2em;
    opacity: 0.9;
}

/* Alternativní styl pro jednoduché stránky bez hlavičky */
.simple-header h1 {
    color: var(--header-color);
    text-align: center;
    font-size: 2.4em;
    margin-bottom: 30px;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 15px;
}

/* Styly pro nadpisy */
h1 {
    color: var(--header-color);
    text-align: center;
    font-size: 2.4em;
    margin-bottom: 30px;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 15px;
}

h2 {
    font-size: 2.2em;
    color: var(--header-color);
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

h4 {
    font-size: 1.3em;
    color: var(--secondary-color);
    margin-top: 25px;
    margin-bottom: 12px;
}

/* Sekce a kontejnery */
.unit-section, .section {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 35px;
    padding: 25px 30px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.unit-section:hover, .section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* Pro stránky s jednoduchým layoutem bez sekcí */
.simple-layout {
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 30px 40px;
    border: 1px solid var(--border-color);
}

/* Schémata a diagramy */
.schema-container {
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    background-color: #f0f8ff;
    border-radius: 8px;
}

.schema-container svg {
    max-width: 100%;
    height: auto;
}

/* Vzorce a rovnice */
.equations, .formula-box, .box {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--formula-bg);
    border: 2px solid var(--formula-border);
    border-radius: 8px;
    font-size: 1.1em;
    overflow-x: auto;
}

.formula-box strong {
    color: #856404;
    font-size: 1.2em;
}

/* Příklady */
.example {
    margin-top: 20px;
    padding: 20px;
    background-color: #fdfdfd;
    border: 1px solid #f0f0f0;
    border-left: 5px solid var(--accent-color);
    border-radius: 5px;
}

/* Výsledky */
.result-box {
    background-color: var(--result-bg);
    border: 2px solid var(--result-border);
    padding: 25px;
    margin-top: 30px;
    border-radius: 10px;
    text-align: center;
}

.result-box p {
    font-size: 1.3em;
    margin: 15px 0;
    font-weight: 500;
}

.result-box span {
    font-weight: bold;
    color: #155724;
    font-size: 1.4em;
}

/* Poznámky */
.note, .intro-box {
    background-color: var(--note-bg);
    border: 1px solid var(--note-border);
    border-left: 4px solid var(--note-border);
    padding: 20px;
    margin: 20px 0;
    border-radius: 6px;
}

.intro-box {
    background-color: #fffbe6;
    border: 1px solid #ffeeba;
    border-left: 5px solid var(--accent-color);
    margin: 30px 0;
    border-radius: 8px;
}

/* Strategie box */
.strategy-box {
    background-color: #fef5e7;
    border: 1px solid #f39c12;
    border-left: 5px solid #f39c12;
    padding: 20px;
    margin: 30px 0;
    border-radius: 8px;
}

/* Tabulky */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 1.1em;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 15px 12px;
    text-align: left;
}

th {
    background-color: #eaf6ff;
    color: var(--primary-color);
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

td code, .variable {
    font-weight: bold;
    color: #d6336c;
    background-color: #e3f2fd;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Jednotky a hodnoty */
.unit {
    color: #e74c3c;
    font-style: italic;
    font-weight: 500;
}

.value {
    color: #8e44ad;
    font-weight: bold;
}

/* Kód */
code {
    background-color: #e9ecef;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Styly pro kalkulátory */
.calculator-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #005A9C;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 8px rgba(0, 90, 156, 0.1);
}

.calculator-container h3 {
    color: #005A9C;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #005A9C;
    padding-bottom: 8px;
}

.calc-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.input-group input {
    padding: 10px 12px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #005A9C;
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1);
}

.calc-button {
    background: linear-gradient(135deg, #005A9C 0%, #003d6b 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    grid-column: 1 / -1;
    justify-self: center;
    min-width: 150px;
}

.calc-button:hover {
    background: linear-gradient(135deg, #003d6b 0%, #002952 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 90, 156, 0.3);
}

.calc-button:active {
    transform: translateY(0);
}

.calc-result {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    min-height: 50px;
}

.calc-result h4 {
    color: #005A9C;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.calc-result .highlight {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    color: #2d3748;
}

.calc-result p {
    margin: 8px 0;
    line-height: 1.4;
}

/* Styly pro comparison-box */
.comparison-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.comparison-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #ced4da;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.comparison-item h4 {
    color: #005A9C;
    margin-bottom: 10px;
    font-size: 1.1em;
    border-bottom: 1px solid #ced4da;
    padding-bottom: 5px;
}

.comparison-item ul {
    margin: 10px 0;
    padding-left: 20px;
}

.comparison-item li {
    margin: 5px 0;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .comparison-box {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Styly pro interaktivní simulace */
.interactive-simulation {
    background: linear-gradient(135deg, #e8f4f8 0%, #d1ecf1 100%);
    border: 2px solid #005A9C;
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 6px 12px rgba(0, 90, 156, 0.15);
}

.interactive-simulation h3 {
    color: #005A9C;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
    border-bottom: 3px solid #005A9C;
    padding-bottom: 10px;
}

/* Demo oblasti pro animace */
.demo-area {
    position: relative;
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border: 2px solid #bbb;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.demo-area.vertical {
    height: 200px;
    width: 80px;
    margin: 20px auto;
}

/* Pohybující se objekty */
.moving-object {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: 50%;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.falling-object {
    position: absolute;
    width: 15px;
    height: 15px;
    background: #2ed573;
    border-radius: 50%;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Značky a popisky */
.track-marker {
    position: absolute;
    bottom: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #2d3748;
}

.height-marker {
    position: absolute;
    left: -50px;
    font-size: 11px;
    font-weight: 600;
    color: #2d3748;
    width: 40px;
    text-align: right;
}

/* Ovládací prvky */
.simulation-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.sim-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.start-btn {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    color: white;
}

.start-btn:hover {
    background: linear-gradient(135deg, #2f855a 0%, #276749 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.3);
}

.reset-btn {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #c53030 0%, #9c2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

/* Informační panel */
.simulation-info {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    font-size: 0.95em;
}

.simulation-info span {
    color: #2d3748;
}

/* Responzivní design pro simulace */
@media (max-width: 768px) {
    .interactive-simulation {
        padding: 15px;
        margin: 20px 0;
    }

    .simulation-controls {
        flex-direction: column;
        align-items: center;
    }

    .sim-button {
        min-width: 200px;
    }

    .demo-area.vertical {
        width: 60px;
        height: 150px;
    }
}

/* CSS animace pro kruhový pohyb */
@keyframes rotate {
    from {
        transform: translateX(-50%) rotate(0deg);
    }
    to {
        transform: translateX(-50%) rotate(360deg);
    }
}

/* Responzivní design */
@media (max-width: 768px) {
    main {
        padding: 15px;
    }
    
    .simple-layout {
        padding: 20px 25px;
    }
    
    header h1, .simple-header h1 {
        font-size: 2em;
    }
    
    h2 {
        font-size: 1.8em;
    }
    
    h3 {
        font-size: 1.4em;
    }
    
    table {
        font-size: 1em;
    }
    
    .unit-section, .section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1, .simple-header h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.6em;
    }
    
    .unit-section, .section {
        padding: 15px;
    }
}
