/* Driehoek.org - Main Stylesheet */
/* Optimized for performance and SEO */

/* Extended styles beyond critical CSS in index.html */

/* Typography Scale */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

/* Utility Classes */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }

/* Forms */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

tr:hover {
    background-color: #f9f9f9;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.card-body {
    color: var(--text-light);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 20px;
    text-align: center;
}

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

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #333;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #1976d2;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.alert-warning {
    background-color: #fff3e0;
    color: #f57c00;
    border-left: 4px solid #f57c00;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

/* Progress Bar */
.progress {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 2rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-light);
    transition: all 0.3s;
    position: relative;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content {
    padding: 2rem 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 0.5rem;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Triangle Illustrations */
.triangle-svg {
    max-width: 100%;
    height: auto;
}

.triangle-interactive {
    cursor: pointer;
    transition: transform 0.3s;
}

.triangle-interactive:hover {
    transform: scale(1.05);
}

/* Calculator Specific Styles */
.calculator-input {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.calculator-output {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.formula-display {
    background: #f0f0f0;
    padding: 1rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    margin: 1rem 0;
    overflow-x: auto;
}

/* Quiz Styles */
.quiz-question {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.quiz-options {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.quiz-option {
    padding: 1rem;
    margin: 0.5rem 0;
    background: var(--bg-light);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.quiz-option:hover {
    background: #e8e8e8;
    border-color: var(--primary-color);
}

.quiz-option.selected {
    background: rgba(255, 107, 53, 0.1);
    border-color: var(--primary-color);
}

.quiz-option.correct {
    background: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
}

.quiz-option.incorrect {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    font-size: 0.875rem;
}

.breadcrumbs a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs span {
    margin: 0 0.5rem;
    color: var(--text-light);
}

/* Print Styles */
@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .container {
        max-width: 100%;
    }

    h1 { font-size: 24pt; }
    h2 { font-size: 18pt; }
    h3 { font-size: 14pt; }

    a {
        color: black;
        text-decoration: underline;
    }

    .btn {
        display: none;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100000;
}

.skip-to-content:focus {
    top: 0;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (if user prefers) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-white: #1a1a1a;
        --bg-light: #2a2a2a;
        --text-dark: #f0f0f0;
        --text-light: #b0b0b0;
    }

    body {
        background: var(--bg-white);
        color: var(--text-dark);
    }

    .card,
    .feature-card,
    .info-card {
        background: var(--bg-light);
    }

    input,
    select,
    textarea {
        background: var(--bg-light);
        color: var(--text-dark);
        border-color: #444;
    }
}