/**
 * TacDesk Changelog Styles
 *
 * Matches tacdesk.co.uk branding
 */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --navy-dark: #1a2332;
    --navy: #243044;
    --navy-light: #2d3a4f;
    --green: #22c55e;
    --green-hover: #16a34a;
    --text-white: #ffffff;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1e293b;
    background: #f1f5f9;
    min-height: 100vh;
}

/* Container */
.changelog-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

/* Header - Dark Navy */
.changelog-header {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    text-align: center;
    padding: 48px 24px;
    margin-bottom: 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-white);
}

.changelog-header h1 {
    margin: 0 0 8px 0;
    font-size: 36px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

@media (min-width: 640px) {
    .changelog-header h1 {
        font-size: 42px;
    }
}

.subtitle {
    margin: 0;
    font-size: 18px;
    color: var(--text-light);
}

/* Controls */
.changelog-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.search-box input::placeholder {
    color: #94a3b8;
}

.version-count {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Error */
.changelog-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    margin: 24px;
    border-radius: 0 8px 8px 0;
}

.changelog-error svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.changelog-error p {
    margin: 0;
}

/* Empty state */
.changelog-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* Entries */
.changelog-entries {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #e2e8f0;
}

.changelog-entry {
    background: #fff;
    padding: 20px 24px;
    transition: background 0.15s;
}

.changelog-entry:hover {
    background: #f8fafc;
}

.changelog-entry.highlighted {
    animation: highlight-pulse 2s ease-out;
}

@keyframes highlight-pulse {
    0% {
        background: rgba(34, 197, 94, 0.15);
    }
    100% {
        background: #fff;
    }
}

.entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.version-badge {
    display: inline-flex;
    align-items: center;
}

.version-number {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy-dark);
    background: #e2e8f0;
    padding: 4px 12px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
}

.entry-date {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.entry-changes {
    margin: 0;
    padding: 0;
    list-style: none;
}

.entry-changes li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    color: #475569;
    font-size: 15px;
    line-height: 1.5;
}

.entry-changes li:last-child {
    margin-bottom: 0;
}

.entry-changes li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
}

/* Load more */
.changelog-load-more {
    display: flex;
    justify-content: center;
    padding: 32px 24px;
    background: #fff;
}

.load-more-btn {
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--green);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.load-more-btn:hover {
    background: var(--green-hover);
}

.load-more-btn:active {
    transform: scale(0.98);
}

/* No results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    color: #94a3b8;
}

.no-results svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-results p {
    margin: 0;
    font-size: 16px;
}

/* Footer */
.changelog-footer {
    padding: 24px;
    background: var(--navy-dark);
    text-align: center;
}

.changelog-footer p {
    margin: 0;
    font-size: 14px;
    color: var(--text-light);
}

.changelog-footer a {
    color: var(--green);
    text-decoration: none;
    font-weight: 500;
}

.changelog-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .changelog-header {
        padding: 32px 20px;
    }

    .changelog-header h1 {
        font-size: 28px;
    }

    .changelog-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .search-box {
        max-width: none;
    }

    .version-count {
        text-align: center;
    }

    .changelog-entry {
        padding: 16px;
    }

    .entry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Dark mode - matches dark sections of tacdesk.co.uk */
@media (prefers-color-scheme: dark) {
    body {
        background: var(--navy-dark);
        color: #e2e8f0;
    }

    .changelog-controls {
        background: var(--navy);
        border-color: var(--border);
    }

    .search-box input {
        background: var(--navy-dark);
        border-color: var(--border);
        color: #f1f5f9;
    }

    .search-box input:focus {
        border-color: var(--green);
        background: var(--navy-light);
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    }

    .version-count {
        color: var(--text-light);
    }

    .changelog-entries {
        background: var(--border);
    }

    .changelog-entry {
        background: var(--navy);
    }

    .changelog-entry:hover {
        background: var(--navy-light);
    }

    .version-number {
        background: var(--navy-dark);
        color: #e2e8f0;
    }

    .entry-date {
        color: var(--text-light);
    }

    .entry-changes li {
        color: #cbd5e1;
    }

    .changelog-error {
        background: #450a0a;
        border-color: #dc2626;
        color: #fca5a5;
    }

    .changelog-load-more {
        background: var(--navy);
    }

    .no-results {
        background: var(--navy);
    }
}
