/**
 * WordPress Support - Main Stylesheet
 * Custom styles beyond TailwindCSS
 */

/* ========================================
   Base / Reset
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Accessibility - Skip Links
   ======================================== */

.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: #2563eb;
    color: white;
    font-weight: 600;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
    left: 1rem;
    outline: 2px solid white;
    outline-offset: 2px;
}

/* ========================================
   Accessibility - Focus States
   ======================================== */

/* Enhanced focus styles for better visibility */
:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Focus styles for custom interactive elements */
.issue-card:focus,
.urgency-option:focus,
.symptom-option:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 0.75rem;
}

/* Accordion - ta bort ful focus border */
.accordion-trigger:focus {
    outline: none;
}

.accordion-trigger:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 0.75rem;
}

.issue-card:focus-visible,
.urgency-option:focus-visible,
.symptom-option:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Remove default outline when custom focus is applied */
.issue-card:focus:not(:focus-visible),
.urgency-option:focus:not(:focus-visible),
.symptom-option:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   Typography
   ======================================== */

.text-balance {
    text-wrap: balance;
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(-5%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

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

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Staggered animation delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* Start hidden for stagger animations */
[data-animate] {
    opacity: 0;
}

[data-animate].animated {
    opacity: 1;
}

/* ========================================
   Wizard
   ======================================== */

.wizard-step {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    display: none;
}

.wizard-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.wizard-step.exiting {
    opacity: 0;
    transform: translateX(-30px);
}

/* Progress bar */
.wizard-progress {
    transition: width 0.5s ease;
}

/* Option cards */
.wizard-option {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wizard-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.wizard-option.selected {
    border-color: #2563eb;
    background-color: #eff6ff;
}

.wizard-option.selected::after {
    content: '';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    background-color: #2563eb;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
    background-size: 0.875rem;
    background-position: center;
    background-repeat: no-repeat;
}

/* Symptom checkboxes */
.symptom-checkbox {
    transition: all 0.2s ease;
}

.symptom-checkbox:hover {
    background-color: #f8fafc;
}

.symptom-checkbox.checked {
    background-color: #eff6ff;
    border-color: #2563eb;
}

/* ========================================
   FAQ Accordion
   ======================================== */

.faq-item {
    border-bottom: 1px solid #e2e8f0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.25rem 0;
    text-align: left;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: #0f172a;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: #2563eb;
}

.faq-question svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.faq-item.open .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding-bottom: 1.25rem;
}

/* ========================================
   Cards
   ======================================== */

.card {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.card-highlight {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

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

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #e2e8f0;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #e2e8f0;
    color: #475569;
}

.btn-outline:hover:not(:disabled) {
    border-color: #2563eb;
    color: #2563eb;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================
   Forms
   ======================================== */

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: white;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.375rem;
}

.form-hint {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.375rem;
}

/* Honeypot field */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ========================================
   Mobile Menu
   ======================================== */

/* Mobile menu button - synlig under 768px */
.mobile-menu-btn {
    display: none;
}

@media (max-width: 767px) {
    .mobile-menu-btn {
        display: flex;
    }
}

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 50;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 320px;
    background-color: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.open .mobile-menu-content {
    transform: translateX(0);
}

/* ========================================
   Dark Mode
   ======================================== */

.dark {
    color-scheme: dark;
}

.dark body {
    background-color: #0f172a;
    color: #e2e8f0;
}

.dark .card {
    background-color: #1e293b;
    border-color: #334155;
}

.dark .form-input {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.dark .form-input:focus {
    border-color: #3b82f6;
}

/* ========================================
   Loading States
   ======================================== */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   Price Display
   ======================================== */

.price-display {
    font-family: 'Inter', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
}

.price-from {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: normal;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.price-currency {
    font-size: 1.25rem;
    font-weight: 500;
    color: #64748b;
}

/* ========================================
   Trust Badges
   ======================================== */

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #15803d;
}

.trust-badge svg {
    flex-shrink: 0;
}

/* ========================================
   Sticky CTA
   ======================================== */

.sticky-cta {
    position: sticky;
    top: 6rem;
}

@media (max-width: 1024px) {
    .sticky-cta {
        position: relative;
        top: 0;
    }
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    animation: slideInRight 0.3s ease;
}

.toast.success {
    border-left: 4px solid #22c55e;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

/* ========================================
   Scroll to top button
   ======================================== */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background-color: #2563eb;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(1rem);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    z-index: 40;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
}

/* ========================================
   Print styles
   ======================================== */

@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        font-size: 12pt;
    }
    
    a {
        text-decoration: none;
        color: inherit;
    }
}
