/* Base Styles - Grundlegende HTML und Typography Styles */

/* General Body & Font Styles */
html, body {
    font-family: 'Segoe UI', sans-serif;
    box-sizing: border-box;
    width: 100%;
    scroll-behavior: smooth;
    margin: 0 !important;
    background-color: var(--page-bg, #0b1724);
    color: var(--text-main, #e2e8f0);
}

body.modal-open {
    overflow: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Garamond', cursive;
    color: var(--heading-color, #4275aa);
}

footer h3 {
    font-family: 'Inter', sans-serif;
    color: #fff; /* Footer often stays dark in many designs */
}

/* Custom Buttons */
.btn-primary-custom, .btn-secondary-custom, .btn-secondary-custom-blue {
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #fff;
    border: none;
    font-weight: 600;
}

.btn-primary-custom:disabled {
    background-color: #4b5563; /* Darkened from #6b7280 */
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-primary-custom {
    background: var(--accent-gradient);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-secondary-custom {
    background-color: var(--text-muted);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary-custom:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -3px var(--accent-glow);
}

.btn-primary-custom:disabled:hover {
    background-color: #6b7280;
    transform: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-secondary-custom:hover {
    background-color: #374151; /* Darkened from #4a5568 */
    transform: translateY(-2px);
}

.btn-secondary-custom-blue {
    background-color: #4275aa;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-secondary-custom-orange {
    background: var(--accent-gradient);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-secondary-custom-orange:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -3px var(--accent-glow);
}

.btn-secondary-custom-orange:disabled {
    background-color: #4b5563; /* Darkened from #6b7280 */
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Give the blue secondary the same hover animation as primary but transition to orange */
.btn-secondary-custom-blue:hover {
    background: var(--accent-gradient); /* transition to accent on hover */
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -3px var(--accent-glow); /* accent glow */
}

.btn-secondary-custom-blue:disabled {
    background-color: #6b7280;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Accessibility Utilities */
.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.visually-hidden-focusable:active, .visually-hidden-focusable:focus {
    position: static !important;
    height: auto;
    width: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus styles for keyboard users */
:focus {
    outline: 3px solid var(--accent-primary);
    outline-offset: 3px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Highlight focused links and buttons */
a:focus, button:focus {
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Ensure interactive elements have sufficient contrast on focus */
button:focus, a:focus, input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Ensure high contrast for skip link when visible */
.skip-link {
    position: absolute;
    left: 0;
    top: -40px;
    background: var(--accent-primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 10px;
}

/* Global spinner overlay for async operations */
.global-spinner-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(3,7,18,0.45);
    z-index: 99999;
    backdrop-filter: blur(4px) saturate(120%);
}
.global-spinner-overlay.show {
    display: flex;
    animation: fadeIn .18s ease-out both;
}
.global-spinner {
    width: 64px;
    height: 64px;
    border-radius: 9999px;
    display: inline-block;
    border: 6px solid rgba(255,255,255,0.12);
    border-top-color: rgba(249,115,22,0.95);
    animation: spin 0.9s linear infinite;
    box-shadow: 0 8px 30px rgba(249,115,22,0.12), inset 0 -4px 12px rgba(0,0,0,0.15);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.95;
}
.btn-loading .btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}
.spinner-border.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}
