/* CSS Variable Overrides */
:root,
:root:not([data-theme]) {
    --bulma-scheme-main: #e8eef7;
    --bulma-scheme-main-bis: #d4e1f5;
    --bulma-scheme-main-ter: #667eea;
}

[data-theme="light"] {
    --bulma-scheme-main: #e8eef7;
    --bulma-scheme-main-bis: #d4e1f5;
    --bulma-scheme-main-ter: #667eea;
}

[data-theme="dark"] {
    --bulma-scheme-main: #1a1f2e;
    --bulma-scheme-main-bis: #1e3a8a;
    --bulma-scheme-main-ter: #667eea;
}

html {
    background-color: var(--bulma-scheme-main) !important;
}

body {
    background-color: var(--bulma-scheme-main) !important;
    color: var(--bulma-text) !important;
}

/* Subscribe box styling */
.subscribe-box {
    background: linear-gradient(to bottom, var(--bulma-scheme-main) 0%, var(--bulma-scheme-main-bis) 100%) !important;
    border: 2px solid var(--bulma-scheme-main-ter) !important;
}

/* Custom story card styling */
.story-card {
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.story-card .card-content a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.story-card .card-content a:hover {
    color: inherit;
}

/* Enhanced Button States */
.button {
    transition: all 0.2s ease;
    min-height: 44px; /* WCAG touch target minimum */
}

.button:focus,
.button:focus-visible {
    outline: 3px solid var(--bulma-scheme-main-ter, #667eea);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.button:active {
    transform: scale(0.98);
}

.button.is-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.button.is-primary:active {
    transform: translateY(0);
}

/* Ensure all interactive elements meet touch target size */
a, button, input[type="submit"], input[type="button"],
.clickable, [role="button"], [tabindex]:not([tabindex="-1"]) {
    min-height: 44px;
}

/* Specific adjustments for inputs */
.input, .textarea, .select select {
    min-height: 44px;
}

/* Dark mode button styling - explicit dark theme */
[data-theme="dark"] .button.is-light {
    background-color: var(--bulma-scheme-main-bis);
    border-color: #3a3a3a;
    color: #e0e0e0;
}

[data-theme="dark"] .button.is-light:hover {
    background-color: var(--bulma-scheme-main-ter);
    border-color: #444;
    color: #fff;
}

/* Dark mode button styling - system preference (when no explicit theme set) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .button.is-light {
        background-color: var(--bulma-scheme-main-bis);
        border-color: #3a3a3a;
        color: #e0e0e0;
    }

    :root:not([data-theme="light"]) .button.is-light:hover {
        background-color: var(--bulma-scheme-main-ter);
        border-color: #444;
        color: #fff;
    }
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    display: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    padding: 0;
}

.scroll-to-top.is-visible {
    display: flex;
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bulma-scheme-main, #fff);
    border-top: 2px solid var(--bulma-primary, #485fc7);
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    animation: slideUp 0.3s ease;
}

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

/* Success/Error Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(72, 187, 120, 0);
    }
}

.notification {
    animation: fadeInScale 0.3s ease-out;
}

.notification.is-success {
    animation: fadeInScale 0.3s ease-out, successPulse 1s ease-out 0.3s;
}

/* Loading Button State Enhancement */
.button.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

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

.cookie-consent-content p {
    margin: 0;
    flex: 1;
}

.cookie-consent-content .buttons {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Additional mobile improvements */
@media screen and (max-width: 768px) {
    .buttons {
        flex-wrap: nowrap;
    }

    .button {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Print styles */
@media print {
    .subscribe-box {
        display: none !important;
    }
}
