/*
 * Dziennik zmian (/changelog.php) — style. Port 1:1 v1 changelog.php l.225-658
 * (.worktrees/v1, inline <style>), w tym ręczna reimplementacja klas
 * Tailwind-podobnych (l.618-657, "Tailwind-like utilities" — v1 changelog.php
 * NIE ładuje CDN Tailwind, jedyna strona z 5 stron F3 bez tego CDN-a).
 * Ładowany przez <link> w templates/pages/changelog/head.php (cache-bust
 * ?v=APP_VERSION), zamiast v1 inline <style> — sankcjonowana zmiana F3.
 */

:root {
    --primary: #2E7D32;
    --primary-light: #4CAF50;
    --primary-dark: #1B5E20;
    --cream: #F9F7F2;
    --graphite: #37474F;

    --bg-primary: #F9F7F2;
    --bg-card: #FFFFFF;
    --text-primary: #37474F;
    --text-secondary: #546E7A;
    --border-color: #E0E0E0;
}

.dark {
    --bg-primary: #1a1a1a;
    --bg-card: #2d2d2d;
    --text-primary: #E8F5E9;
    --text-secondary: #A5D6A7;
    --border-color: #404040;
    --primary: #66BB6A;
    --primary-light: #81C784;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s;
}
.skip-link:focus {
    top: 0;
}

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.back-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}
.theme-btn:hover {
    background: rgba(255,255,255,0.25);
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.intro {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.intro h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--primary);
}

.intro p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--border-color));
}

.release {
    position: relative;
    margin-bottom: 24px;
    padding-left: 56px;
}

.release-dot {
    position: absolute;
    left: 12px;
    top: 8px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    z-index: 1;
}

.release.major .release-dot {
    width: 22px;
    height: 22px;
    left: 10px;
    top: 6px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.2);
}

.release-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.release-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.release-version {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.release-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 20px;
}

.release-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.change-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.change-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background 0.2s;
}

.change-item:hover {
    background: var(--bg-primary);
}

.change-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.change-icon svg {
    width: 14px;
    height: 14px;
}

.change-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.change-type {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.legend {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.legend h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.legend-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.legend-icon svg {
    width: 12px;
    height: 12px;
}

@media (max-width: 640px) {
    .header h1 {
        font-size: 1.1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .release {
        padding-left: 48px;
    }

    .timeline::before {
        left: 16px;
    }

    .release-dot {
        left: 8px;
    }

    .release.major .release-dot {
        left: 6px;
    }

    .legend-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Tailwind-like utilities */
.text-green-600 { color: #16a34a; }
.text-blue-600 { color: #2563eb; }
.text-red-600 { color: #dc2626; }
.text-purple-600 { color: #9333ea; }
.text-yellow-600 { color: #ca8a04; }
.text-pink-600 { color: #db2777; }
.text-gray-600 { color: #4b5563; }
.text-orange-600 { color: #ea580c; }
.text-teal-600 { color: #0d9488; }

.dark .text-green-400 { color: #4ade80; }
.dark .text-blue-400 { color: #60a5fa; }
.dark .text-red-400 { color: #f87171; }
.dark .text-purple-400 { color: #c084fc; }
.dark .text-yellow-400 { color: #facc15; }
.dark .text-pink-400 { color: #f472b6; }
.dark .text-gray-400 { color: #9ca3af; }
.dark .text-orange-400 { color: #fb923c; }
.dark .text-teal-400 { color: #2dd4bf; }

.bg-green-100 { background: #dcfce7; }
.bg-blue-100 { background: #dbeafe; }
.bg-red-100 { background: #fee2e2; }
.bg-purple-100 { background: #f3e8ff; }
.bg-yellow-100 { background: #fef9c3; }
.bg-pink-100 { background: #fce7f3; }
.bg-gray-100 { background: #f3f4f6; }
.bg-orange-100 { background: #ffedd5; }
.bg-teal-100 { background: #ccfbf1; }

.dark .bg-green-900\/30 { background: rgba(20, 83, 45, 0.3); }
.dark .bg-blue-900\/30 { background: rgba(30, 58, 138, 0.3); }
.dark .bg-red-900\/30 { background: rgba(127, 29, 29, 0.3); }
.dark .bg-purple-900\/30 { background: rgba(88, 28, 135, 0.3); }
.dark .bg-yellow-900\/30 { background: rgba(113, 63, 18, 0.3); }
.dark .bg-pink-900\/30 { background: rgba(131, 24, 67, 0.3); }
.dark .bg-gray-900\/30 { background: rgba(17, 24, 39, 0.3); }
.dark .bg-orange-900\/30 { background: rgba(124, 45, 18, 0.3); }
.dark .bg-teal-900\/30 { background: rgba(19, 78, 74, 0.3); }
