/**
 * Optimized Comparison Pages CSS
 * 
 * This file contains optimized styles for all comparison pages.
 * 
 * Performance optimizations:
 * - Minimal CSS
 * - Efficient selectors
 * - Optimized animations
 * - Responsive design
 */

/* Performance: Critical above-the-fold styles */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Performance: Optimized button styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #4D8EF3;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #3B82F6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(77, 142, 243, 0.3);
}

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

.btn-outline:hover {
    background: #4D8EF3;
    color: white;
}

/* Performance: Optimized table styles */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.comparison-table th,
.comparison-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.comparison-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #111827;
}

.comparison-table tbody tr:hover {
    background: #f9fafb;
}

/* Performance: Optimized feature comparison styles */
.feature-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.feature-card.ordio {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #4D8EF3;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.feature-list li:last-child {
    margin-bottom: 0;
}

.feature-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* Performance: Optimized FAQ styles */
.faq-section {
    max-width: 48rem;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-bottom: 1rem;
}

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

.faq-question:hover {
    background: #f9fafb;
}

.faq-question.active {
    background: #f9fafb;
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: #6b7280;
    line-height: 1.6;
}

.faq-arrow {
    width: 1.25rem;
    height: 1.25rem;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.faq-arrow.rotated {
    transform: rotate(180deg);
}

/* Performance: Optimized CTA section styles */
.cta-section {
    background: linear-gradient(135deg, #4D8EF3 0%, #3B82F6 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.cta-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-section .btn {
    background: white;
    color: #4D8EF3;
    font-weight: 600;
}

.cta-section .btn:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Performance: Optimized animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Performance: Optimized responsive design */
@media (max-width: 768px) {
    .hero {
        min-height: 50vh;
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .feature-comparison {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .comparison-table {
        font-size: 0.875rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.875rem;
    }
}

/* Performance: Optimized print styles */
@media print {
    .btn,
    .faq-question,
    .hero {
        display: none;
    }
    
    .comparison-table {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .feature-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Comparison Page Specific Styles - Extracted from inline styles */
/* Star SVGs */
.star-svg {
    fill: #facc15 !important;
}
.star-svg-empty {
    fill: #d1d5db !important;
}
.star-svg svg[viewBox="0 0 20 20"] path {
    fill: #facc15 !important;
}
.star-svg svg[viewBox="0 0 20 20"] path[fill="#d1d5db"] {
    fill: #d1d5db !important;
}

/* Rating Bar Hover Tooltips */
.rating-bar-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
    vertical-align: middle;
    min-height: auto !important;
    min-width: auto !important;
    padding: 0 !important;
}

.rating-row {
    display: flex;
    align-items: center;
    min-height: 28px;
    line-height: 1;
    position: relative;
}

.rating-row .star-label {
    display: flex;
    align-items: center;
    min-width: 48px;
    line-height: 1;
    font-size: 14px;
    height: 20px;
    vertical-align: middle;
    box-sizing: border-box;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.rating-row .count-label {
    display: flex;
    align-items: center;
    min-width: 32px;
    justify-content: flex-end;
    line-height: 1;
    font-size: 14px;
    height: 20px;
    vertical-align: middle;
    box-sizing: border-box;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.rating-row .star-label,
.rating-row .count-label,
.rating-row .rating-bar-bg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rating-bar-bg {
    display: flex;
    align-items: center;
    height: 12px !important;
    min-height: 12px !important;
    position: relative;
    overflow: hidden;
    flex: 1;
    margin: 0 12px;
    transition: all 0.3s ease;
    padding: 0 !important;
}

.rating-bar-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: auto !important;
    min-width: auto !important;
    padding: 0 !important;
}

.rating-bar-fill {
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
}

.rating-bar-container:hover .rating-bar-fill {
    background-color: #2563eb !important;
    transform: scaleY(1.1);
    transition: all 0.3s ease;
}

.rating-bar-container:hover .rating-bar-bg {
    background-color: #e5e7eb;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.rating-tooltip {
    position: fixed;
    padding: 8px 12px;
    background-color: #1f2937;
    color: #ffffff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translate(-50%, -100%);
    margin-top: -8px;
}

.rating-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}

.rating-tooltip.show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

.comparison-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.comparison-card .space-y-6 > div:not(:last-child) {
    margin-bottom: 2rem;
}

.comparison-card .mb-6 {
    margin-bottom: 2rem;
}

/* FAQ Animation Enhancements */
details[open] summary {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

details summary svg {
    transition: transform 0.3s ease-in-out;
    transform: rotate(0deg);
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

details[open] summary svg {
    transform: rotate(180deg);
}

details summary:hover svg {
    color: #3b82f6;
}

details summary:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Focus indicators for accessibility - WCAG AA compliant */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Ensure sufficient contrast for focus indicators */
.rating-bar-container:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* High contrast focus for better visibility */
@media (prefers-contrast: high) {
    button:focus,
    a:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid #000;
        outline-offset: 3px;
    }
}

details[open] .mt-4 {
    animation: fadeInDown 0.3s ease-in-out;
    will-change: transform, opacity;
}

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

/* Checkmark Styles */
.ordio-features svg[viewBox="0 0 20 20"],
.ordio-features svg[fill="#10b981"],
.ordio-features svg path[fill-rule="evenodd"] {
    fill: #10b981 !important;
    color: #10b981 !important;
}

.ordio-features .flex.items-center svg {
    fill: #10b981 !important;
    color: #10b981 !important;
}

.ordio-features svg path[d*="M16.707 5.293"] {
    fill: #10b981 !important;
}

.ordio-features .text-gray-600 svg {
    fill: #10b981 !important;
    color: #10b981 !important;
}

.checkmark-container .checkmark-icon,
.checkmark-icon {
    fill: #10b981 !important;
    color: #10b981 !important;
}

.ordio-features .checkmark-container svg,
.ordio-features .checkmark-icon {
    fill: #10b981 !important;
    color: #10b981 !important;
}

.checkmark-list {
    list-style: none;
    padding-left: 0;
}

.checkmark-list li {
    position: relative;
    padding-left: 25px;
}

.checkmark-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: #10b981;
    font-size: 1.1em;
    font-weight: bold;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .rating-bar-container,
    .rating-bar-fill,
    .rating-tooltip,
    details summary svg {
        transition: none;
    }
    details[open] .mt-4 {
        animation: none;
    }
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .rating-tooltip {
        font-size: 11px;
        padding: 4px 8px;
        top: -30px;
    }
}

/* Touch target sizes - WCAG AA compliant (minimum 44x44px) */
/* Exclude navbar buttons - they have their own styling */
body > *:not(header):not(nav):not(footer) button:not(.rating-bar-container):not(.rating-bar-fill):not(.w-3):not(.h-3),
body > *:not(header):not(nav):not(footer) a[role="button"],
body > *:not(header):not(nav):not(footer) input[type="button"],
body > *:not(header):not(nav):not(footer) input[type="submit"],
body > *:not(header):not(nav):not(footer) input[type="reset"] {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
}

/* Ensure slider navigation buttons meet touch target requirements */
button[aria-label*="Slider Navigation"] {
    min-height: 44px;
    min-width: 44px;
    padding: 12px;
}

/* Carousel pagination bullets should NOT have touch target sizing - they are small visual indicators */
#compare-carousel-section button.w-3.h-3,
#compare-carousel-section button[class*="w-3"][class*="h-3"] {
    min-height: auto !important;
    min-width: auto !important;
    padding: 0 !important;
    width: 12px !important;
    height: 12px !important;
}

/* Ensure FAQ buttons meet touch target requirements */
details summary {
    min-height: 44px;
    padding: 12px 16px;
}

/* Rating bars should NOT have touch target sizing - they are visual elements, not interactive buttons */
.rating-bar-container,
.rating-bar-bg,
.rating-bar-fill {
    min-height: auto !important;
    min-width: auto !important;
    padding: 0 !important;
}

/* Ensure links meet touch target requirements - ONLY for main content, NOT navbar/footer/banner */
/* Apply touch target sizing only to main content links that don't have specific exclusions */
/* The :not(header):not(nav):not(footer) selector ensures navbar elements are excluded */
body > *:not(header):not(nav):not(footer):not([class*="bg-[#232529]"]) a:not([class*="text-"]):not(.topteaser-link):not([href="/series-a-finanzierung"]):not([href="/impressum"]):not([href="/datenschutz"]):not([href*="instagram.com"]):not([href*="linkedin.com"]):not([class*="transition"]):not([class*="hover:scale"]):not([class*="opacity-70"]):not([class*="opacity-50"]):not([class*="rounded-full"]):not([class*="hover:bg-white"]):not([class*="hover:bg-[#fbfbfb]"]) {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
}

/* Banner/topteaser links should NOT have touch target sizing - they are small text links */
.topteaser-link,
a.topteaser-link,
div[class*="bg-[#232529]"] a,
div[class*="bg-[#232529]"] .topteaser-link {
    min-height: auto !important;
    min-width: auto !important;
    padding: 0 !important;
    display: inline !important;
}

/* Social icon links in footer should NOT have touch target sizing - they are icon links */
footer a[href*="instagram.com"],
footer a[href*="linkedin.com"],
footer a[class*="transition"][class*="hover:scale"],
footer .flex.space-x-6 a {
    min-height: auto !important;
    min-width: auto !important;
    padding: 0 !important;
    display: inline-flex !important;
}

/* Logo Slider Animation - optimized for compositing */
.logo-slider {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes slide {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Rotating Element - optimized for compositing */
#rotating-element {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Image Transitions - optimized for compositing */
img[class*="transition"] {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Rating Bar Animations - optimized for compositing */
.rating-bar-fill {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.rating-bar-container:hover .rating-bar-fill {
    will-change: transform;
}