/*
 * BasicFakta.no Styles
 * Theme: Nordic Slate & Emerald
 * Author: Alem Basic
 */

/* ═══════════════════════════════════════════════════════════
   RESET
   ═══════════════════════════════════════════════════════════ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: var(--leading-normal);
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: var(--container-lg);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */

.header {
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.logo-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.logo-text {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
}

.logo-accent {
    color: var(--accent);
}

.personalization-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
}

.badge-label {
    color: var(--text-muted);
}

.badge-name {
    color: var(--text-primary);
    font-weight: var(--font-medium);
}

/* Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
}

.lang-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-weight: var(--font-medium);
}

.lang-link:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.lang-link.active {
    color: var(--accent);
    background: var(--accent-subtle);
}

.lang-divider {
    color: var(--border);
}

/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */

.hero {
    padding: var(--space-16) 0 var(--space-8);
    text-align: center;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--accent-subtle);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--accent);
    margin-bottom: var(--space-6);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.title-highlight {
    color: var(--accent);
}

.hero-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════
   INPUT SECTION
   ═══════════════════════════════════════════════════════════ */

.input-section {
    margin-bottom: var(--space-8);
}

.input-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
}

.input-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}

.textarea-wrapper {
    margin-bottom: var(--space-4);
}

.textarea,
#textInput {
    width: 100%;
    min-height: 180px;
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    resize: vertical;
    transition: var(--transition-fast);
}

.textarea:focus,
#textInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.textarea::placeholder,
#textInput::placeholder {
    color: var(--text-dim);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Buttons */
.btn,
.analyze-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--accent);
    color: white;
}

.btn:hover,
.analyze-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn:active,
.analyze-btn:active {
    transform: translateY(0);
}

.btn:disabled,
.analyze-btn:disabled {
    background: var(--bg-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn svg,
.analyze-btn svg {
    width: 18px;
    height: 18px;
}

/* ═══════════════════════════════════════════════════════════
   RESULTS
   ═══════════════════════════════════════════════════════════ */

.results-section {
    display: none;
    margin-bottom: var(--space-8);
}

.results-section.visible {
    display: block;
}

.results-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
}

.results-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.results-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-2);
}

/* Score Cards */
.score-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.score-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
}

.score-card.fact,
.score-card.verified {
    border-color: var(--verified-border);
    background: var(--verified-bg);
}

.score-card.bs,
.score-card.false {
    border-color: var(--false-border);
    background: var(--false-bg);
}

.score-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.score-value {
    font-family: var(--font-mono);
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
}

.score-card.fact .score-value,
.score-card.verified .score-value {
    color: var(--verified);
}

.score-card.bs .score-value,
.score-card.false .score-value {
    color: var(--false);
}

/* Breakdown */
.breakdown-section {
    margin-top: var(--space-6);
}

.breakdown-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.breakdown-list {
    list-style: none;
}

.breakdown-item {
    padding: var(--space-4);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
}

.verdict-badge {
    flex-shrink: 0;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
}

.verdict-badge.fakta,
.verdict-badge.verified {
    background: var(--verified-bg);
    color: var(--verified);
    border: 1px solid var(--verified-border);
}

.verdict-badge.usant,
.verdict-badge.false {
    background: var(--false-bg);
    color: var(--false);
    border: 1px solid var(--false-border);
}

.verdict-badge.delvis,
.verdict-badge.partial {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.breakdown-content {
    flex: 1;
}

.breakdown-claim {
    font-weight: var(--font-medium);
    margin-bottom: var(--space-1);
    color: var(--text-primary);
}

.breakdown-explanation {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Summary */
.summary-section {
    margin-top: var(--space-6);
    padding: var(--space-4) var(--space-6);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--accent);
}

.summary-text {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
}

/* ═══════════════════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════════════════ */

.loading-section {
    display: none;
    text-align: center;
    padding: var(--space-12) 0;
}

.loading-section.visible {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-4);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   RANDOM ACT OF KINDNESS
   ═══════════════════════════════════════════════════════════ */

.kindness-section {
    padding: var(--space-12) 0;
}

.kindness-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.kindness-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f472b6, #ec4899, #db2777);
}

.kindness-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-4);
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kindness-icon svg {
    width: 28px;
    height: 28px;
    stroke: #ec4899;
}

.kindness-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.kindness-text {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    max-width: 500px;
    margin: 0 auto;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kindness-refresh {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.kindness-refresh:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
}

.kindness-refresh svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    transition: stroke 0.2s ease;
}

.kindness-refresh:hover svg {
    stroke: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */

.footer {
    margin-top: auto;
    padding: var(--space-8) 0;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.footer-content {
    font-size: var(--text-sm);
    color: var(--text-dim);
}

.footer-author {
    color: var(--text-muted);
}

.footer-service {
    font-size: var(--text-xs);
    color: var(--text-dim);
    margin-top: var(--space-2);
}

.footer-service a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-service a:hover {
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════ */

.skip-link {
    position: absolute;
    left: -9999px;
    top: var(--space-4);
    background: var(--accent);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    z-index: 1000;
}

.skip-link:focus {
    left: var(--space-4);
}

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .container {
        padding: 0 var(--space-4);
    }

    .hero {
        padding: var(--space-8) 0 var(--space-6);
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .input-card,
    .results-card {
        padding: var(--space-5);
    }

    .score-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: var(--space-3);
    }

    .header-right {
        flex-direction: column;
        gap: var(--space-2);
    }

    .input-footer {
        flex-direction: column;
        gap: var(--space-3);
    }

    .btn,
    .analyze-btn {
        width: 100%;
    }
}
