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

:root {
    --primary-color: #3b82f6;
    --secondary-color: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #1e293b;
    --card-bg: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    z-index: 1000;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-200%);
    transition: all 0.3s ease;
}

.skip-link:focus {
    top: 0;
    opacity: 1;
    transform: translateY(0);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.back-btn {
    position: absolute;
    top: -50px;
    left: 0;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    display: flex;
    gap: 24px;
    z-index: 100;  
}

.back-btn:hover {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.top-nav {
    position: absolute;
    top: -50px;
    right: 0;
    display: flex;
    gap: 24px;
    z-index: 100;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

header {
    text-align: center;
    margin-top: 60px;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.95;
}

main {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.input-section h2,
.results-section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    text-align: center;
}

#newsInput {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    margin-bottom: 20px;
    background: var(--bg-color);
    color: var(--text-primary);
}

#newsInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.check-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow);
}

.check-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.check-btn:active:not(:disabled) {
    transform: translateY(0);
}

.check-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.results-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.credibility-score-header {
    text-align: center;
    margin-bottom: 12px;
}

.credibility-score-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-badge {
    display: block;
    padding: 20px 30px;
    border-radius: 12px;
    margin: 0 auto 24px auto;
    text-align: center;
    width: fit-content;
}

.score-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.score-label {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-high {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: var(--success-color);
}

.score-medium {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: var(--warning-color);
}

.score-low {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    color: #c2410c;
}

.score-very-low {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    color: var(--danger-color);
}

.analysis-text {
    background: var(--bg-color);
    padding: 24px;
    border-radius: 12px;
    line-height: 1.8;
    font-size: 1rem;
}

.analysis-text p {
    margin-bottom: 16px;
}

.analysis-text p:last-child {
    margin-bottom: 0;
}

.analysis-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.error {
    background: #fee2e2;
    border: 2px solid var(--danger-color);
    border-radius: 12px;
    padding: 20px;
    color: var(--danger-color);
}

.error h3 {
    margin-bottom: 10px;
}

footer {
    text-align: center;
    margin-top: 40px;
    font-size: 0.9rem;
}

footer p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

footer .highlight {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.footer-mobile {
    display: none;
}

.footer-mobile p {
    margin: 8px 0;
}

.info-text {
    text-align: center;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.citations-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--border-color);
}

.citations-section h3 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.citations-list {
    list-style-position: inside;
    padding-left: 0;
}

.citations-list li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.citations-list a {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
    transition: color 0.2s ease;
}

.citations-list a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Copy button */
.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    margin: 0 auto 24px auto;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.copy-icon {
    font-size: 1.2rem;
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--card-bg), #1e293b);
    border-top: 2px solid var(--primary-color);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cookie-text h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.cookie-text p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.cookie-btn.accept {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    box-shadow: var(--shadow);
}

.cookie-btn.accept:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.cookie-btn.reject {
    background: var(--bg-color);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.cookie-btn.reject:hover {
    background: var(--card-bg);
    color: var(--text-primary);
}

/* Responsive design */
@media (max-width: 768px) {
    .back-btn {
        position: static;
        display: block;
        text-align: center;
        margin-bottom: 10px;
        padding-top: 10px;
    }

    .top-nav {
        position: static;
        justify-content: center;
        margin-bottom: 20px;
        padding-top: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    main {
        padding: 24px;
    }

    .score-number {
        font-size: 2rem;
    }

    .score-label {
        font-size: 0.9rem;
    }

    .loading-animation {
        padding: 24px;
    }

    .loading-animation h3 {
        font-size: 1.2rem;
    }

    .spinner {
        width: 50px;
        height: 50px;
    }

    .footer-desktop {
        display: none;
    }

    .footer-mobile {
        display: block;
    }

    .cookie-content {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
    }

    .cookie-text h3 {
        font-size: 1.1rem;
    }

    .cookie-text p {
        font-size: 0.9rem;
    }

    .cookie-buttons {
        width: 100%;
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.btn-loading {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-animation {
    margin-top: 40px;
    padding: 40px;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 16px;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-animation h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
}

.step {
    padding: 12px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    opacity: 0.4;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.step.active {
    opacity: 1;
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.15));
    animation: fadeInUp 0.5s ease;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
