/* Reset a základní styly */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #fafafa;
    color: #212529;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
header {
    background: #fff;
    color: #212529;
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: #212529;
}

.subtitle {
    font-size: 1rem;
    color: #495057;
}

/* Main content */
.main-content {
    padding: 30px;
    display: grid;
    gap: 20px;
}

/* Kartové sekce */
.card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #0d6efd;
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0d6efd;
}

.card h3 {
    color: #495057;
    font-size: 1.2rem;
    margin: 25px 0 15px 0;
}

.card h4 {
    color: #6c757d;
    font-size: 1rem;
    margin: 15px 0 10px 0;
}

/* Schéma */
.schematic-card {
    grid-column: 1 / -1;
}

#schematic {
    width: 100%;
    height: auto;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Formulář */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #495057;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group input[type="number"],
.form-group select {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.form-group select {
    width: 100%;
}

.unit {
    font-weight: 500;
    color: #6c757d;
    min-width: 40px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Button */
.btn-calculate {
    width: 100%;
    padding: 12px 24px;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 10px;
}

.btn-calculate:hover {
    background: #0a58ca;
}

.btn-calculate:active {
    background: #084298;
}

/* Upozornění */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert.success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.alert.warning {
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

.alert.error {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* Tabulky výsledků */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
}

.results-table thead {
    background: #f8f9fa;
}

.results-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.results-table tbody tr:hover {
    background: #f8f9fa;
}

.results-table td:nth-child(2) {
    font-weight: 600;
    color: #0d6efd;
}

/* Poznámky ke vzorcům */
.formula-note {
    background: #f8f9fa;
    border-left: 4px solid #0d6efd;
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
}

.formula-note ul {
    margin: 15px 0;
    padding-left: 25px;
}

.formula-note li {
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    color: #495057;
}

.formula-note p {
    margin-top: 15px;
    font-style: italic;
    color: #6c757d;
}

/* Footer */
footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
}

/* SVG schéma - styly */
.wire {
    stroke: #000;
    stroke-width: 2;
    fill: none;
}

.component-text {
    font-family: Arial, sans-serif;
    font-size: 14px;
    fill: #333;
}

.value-text {
    font-family: Arial, sans-serif;
    font-size: 12px;
    fill: #0d6efd;
    font-weight: 600;
}

.label-text {
    font-family: Arial, sans-serif;
    font-size: 13px;
    fill: #495057;
    font-weight: 500;
}

.resistor {
    stroke: #000;
    stroke-width: 2;
    fill: none;
}

.capacitor {
    stroke: #000;
    stroke-width: 2;
    fill: none;
}

.transistor {
    stroke: #000;
    stroke-width: 2;
    fill: none;
}

.dot {
    fill: #000;
}

/* Responzivní design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .main-content {
        padding: 15px;
    }

    .card {
        padding: 15px;
    }

    .results-table {
        font-size: 0.9rem;
    }

    .results-table th,
    .results-table td {
        padding: 8px;
    }
}

@media (min-width: 992px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
    }

    .schematic-card,
    .results-card {
        grid-column: 1 / -1;
    }
}
