/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
font-display: swap;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    font-size: 16px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

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

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.logo h1 {
    color: #1f2937;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    
}

.nav a:hover {
    color: #2563eb;
}

/* Main Content */
.main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Article */
.article {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.article-header {
    padding: 2rem 0 1rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.article-header h1 {
    font-size: 2.5rem;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    gap: 1rem;
    color: #6b7280;
    font-size: 0.9rem;
}

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

/* Typography */
h2 {
    font-size: 2rem;
    color: #1f2937;
    margin: 2rem 0 1rem 0;
    border-bottom: 3px solid #2563eb;
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
    color: #374151;
    margin: 1.5rem 0 0.75rem 0;
}

h4 {
    font-size: 1.25rem;
    color: #4b5563;
    margin: 1rem 0 0.5rem 0;
}

p {
    margin-bottom: 1rem;
    color: #4b5563;
    text-align: justify;
}

/* Boxes i komponenty */
.highlight-box, .structure-box, .new-rules-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2563eb;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 6px;
}

.highlight-box h3, .structure-box h3, .new-rules-box h3 {
    color: #1d4ed8;
    margin-top: 0;
}

.regulations-list, .functions-list, .features-list {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 6px;
}

.regulations-list h4, .functions-list h4, .features-list h4 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.formula-box {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    text-align: center;
    font-size: 1.2rem;
    color: #92400e;
}

.steps-box {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-left: 4px solid #0ea5e9;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 6px;
}

.steps-box h3 {
    color: #0c4a6e;
    margin-top: 0;
}

.steps-box ol {
    margin-left: 1.5rem;
}

.steps-box li {
    margin-bottom: 0.5rem;
    color: #0f172a;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.tips-box {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 1.5rem;
    border-radius: 6px;
}

.tips-box h4 {
    color: #334155;
    margin-bottom: 1rem;
    border-bottom: 2px solid #64748b;
    padding-bottom: 0.5rem;
}

/* Tabele */
.data-table, .comparison-table, .causes-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
}

.data-table th, .comparison-table th, .causes-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
}

.data-table td, .comparison-table td, .causes-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.data-table tr:hover, .comparison-table tr:hover, .causes-table tr:hover {
    background-color: #f9fafb;
}

.status-safe {
    color: #059669;
    font-weight: 600;
}

.status-danger {
    color: #dc2626;
    font-weight: 600;
}

.table-caption, .chart-caption {
    font-size: 0.9rem;
    color: #6b7280;
    font-style: italic;
    text-align: center;
    margin-top: 0.5rem;
}

/* Wykresy */
.chart-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    height: 500px; /* Ustalona wysokość kontenera */
}

.chart-container canvas {
    max-width: 100%;
    max-height: 400px !important;
    height: 400px !important;
    width: auto !important;
}

.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
}

.chart-container.loaded .chart-loading {
    display: none;
}

/* Quiz */
.quiz-container {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f8ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 1px solid #0ea5e9;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.quiz-container h3 {
    color: #0c4a6e;
    margin-bottom: 1rem;
    text-align: center;
}

.quiz-question {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0f2fe;
}

.quiz-question p {
    margin-bottom: 1rem;
    color: #0f172a;
}

.quiz-question label {
    display: block;
    margin: 0.5rem 0;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    
}

.quiz-question label:hover {
    background-color: #f0f9ff;
}

.quiz-question input[type="radio"] {
    margin-right: 0.5rem;
}

.quiz-button {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.quiz-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
}

#quiz-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
}

/* Key Points i Final Note */
.key-points {
    background: #f0fdf4;
    border: 1px solid #22c55e;
    border-left: 4px solid #22c55e;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 6px;
}

.key-points h3 {
    color: #15803d;
    margin-top: 0;
}

.key-points ul {
    margin-left: 1.5rem;
}

.key-points li {
    margin-bottom: 0.5rem;
    color: #166534;
}

.final-note {
    background: #fef7ed;
    border: 2px solid #f97316;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    text-align: center;
}

.final-note p {
    color: #9a3412;
    font-size: 1.1rem;
    margin: 0;
}

/* Sources section */
.sources {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid #2563eb;
}

.sources h2 {
    margin-top: 0;
}

.sources-list h3 {
    color: #1f2937;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.2rem;
}

.sources-list ul {
    margin-left: 1.5rem;
    margin-bottom: 2rem;
}

.sources-list li {
    margin-bottom: 0.75rem;
}

.sources-list a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.sources-list a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: #1f2937;
    color: #d1d5db;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    width: 100%;
    text-align: center;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    
}

.footer-links a:hover {
    color: #60a5fa;
}

.footer-info {
    text-align: center !important;
    color: #6b7280;
    font-size: 0.9rem;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    display: block;
    position: relative;
}

.footer-info p {
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    display: block;
    width: 100%;
    position: relative;
    left: 0;
    right: 0;
}

/* Lists */
ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.25rem;
    color: #4b5563;
}

strong {
    color: #1f2937;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .logo-img {
        width: 35px;
        height: 35px;
    }
    
    .nav ul {
        gap: 1rem;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        padding: 1rem;
        height: 400px; /* Mniejsza wysokość na mobile */
    }
    
    .chart-container canvas {
        max-height: 300px !important;
        height: 300px !important;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .quiz-container {
        padding: 1rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-info p {
        text-align: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .calculator-container {
        padding: 1rem;
        margin: 1rem auto;
    }
    
    .calculator-form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .form-actions .btn {
        width: 100%;
        max-width: 280px;
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
        min-height: 48px;
        font-weight: 600;
    }
    
    .calculate-row {
        margin: 1rem 0;
        padding-top: 0.5rem;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    

    
    .data-table, .comparison-table, .causes-table {
        font-size: 0.9rem;
    }
    
    .data-table th, .comparison-table th, .causes-table th,
    .data-table td, .comparison-table td, .causes-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .article-header h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .quiz-question label {
        font-size: 0.9rem;
    }
    
    .data-table, .comparison-table, .causes-table {
        font-size: 0.8rem;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Calculator Styles */
.calculator-container {
    max-width: 800px;
    margin: 2rem auto;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calculator-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e1e5e9;
    padding-bottom: 1rem;
}

.calculator-header h1 {
    color: #1f2937;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.calculator-header p {
    color: #6b7280;
    font-size: 1rem;
    text-align: center;
}

.calculator-form {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.calculate-row {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0 1rem 0;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 1rem;
    
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
}

.btn {
    padding: 0.75rem 1.25rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    
    text-decoration: none;
    display: inline-block;
    text-align: center;
    background: #fff;
    min-height: 44px;
}

.btn-primary {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-copy {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}

.btn-copy:hover {
    background: #4b5563;
    border-color: #4b5563;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-height: 36px;
}

/* Lessons text display - mobile critical */
#lessonsTextList {
    width: 100% !important;
    display: block !important;
    min-height: 50px;
}

.lessons-text-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
    display: block !important;
}

.lesson-text-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.lesson-text-main {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.lesson-text-details {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.lesson-status-text.status-safe { color: #059669; font-weight: 600; }
.lesson-status-text.status-warning { color: #d97706; font-weight: 600; }
.lesson-status-text.status-danger { color: #dc2626; font-weight: 600; }

.simple-stats {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid #e5e7eb;
}

.simple-stats p {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: #374151;
}

@media (max-width: 767px) {
    .btn-sm {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 44px;
    }
    
    #lessonsTextList {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .lessons-text-container {
        padding: 1rem;
    }
}



.status-safe {
    color: #28a745;
    font-weight: 600;
}

.status-warning {
    color: #ffc107;
    font-weight: 600;
}

.status-danger {
    color: #dc3545;
    font-weight: 600;
}

.calculator-results {
    background: white;
    border-radius: 4px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert h4 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.alert-success {
    background: #f0f9ff;
    border-left-color: #10b981;
    color: #065f46;
}

.alert-warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}















@media (max-width: 767px) {

}









.recommendations {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.recommendations h5 {
    margin-bottom: 0.75rem;
    color: #1976d2;
}

.recommendations ul {
    margin: 0;
    padding-left: 1.25rem;
}

.recommendations li {
    margin-bottom: 0.5rem;
    color: #424242;
}