/* LLMINATOR layout + komponenty (wcześniej inline w base.html). Tło: --page-bg-image z base.html. */
:root {
    --primary-teal: #14b8a6;
    --secondary-teal: #0d9488;
    --accent-teal: #2dd4bf;
    --light-teal: #ccfbf1;
    --dark-bg: #0f1419;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body {
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #2d3748 100%);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #f8fafc;
    min-height: 100vh;
    overflow-x: hidden;
    overscroll-behavior-y: none;
}
html { overscroll-behavior: none; }

/* Hide scrollbar on gate page */
body.gate-page {
    overflow: hidden;
}

/* Background for non-gate pages - Safari workaround: use real DOM element (body::before unreliable on home in Safari) */
body.gate-page .page-bg-image {
    display: none;
}
.page-bg-image {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background-image: var(--page-bg-image);
    background-position: center center;
    background-repeat: no-repeat;
    -webkit-background-size: cover;
    background-size: cover;
    z-index: -1;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Liquid Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
    contain: layout;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Modern Button Styles */
.btn-primary {
    position: relative;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(20, 184, 166, 0.24));
    color: #ffffff;
    border: 1px solid rgba(20, 184, 166, 0.5);
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 4px 16px rgba(20, 184, 166, 0.18),
        0 2px 8px rgba(20, 184, 166, 0.12),
        0 0 20px rgba(20, 184, 166, 0.08);
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(20, 184, 166, 0.07));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.07) 50%,
        transparent 70%
    );
    animation: shimmer 3s infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.22), rgba(20, 184, 166, 0.3));
    transform: translateY(-1px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 4px 20px rgba(20, 184, 166, 0.22),
        0 2px 10px rgba(20, 184, 166, 0.16),
        0 0 30px rgba(20, 184, 166, 0.1);
}

.btn-secondary {
    position: relative;
    background: linear-gradient(135deg, rgba(29, 30, 31, 0.6), rgba(29, 30, 31, 0.8));
    color: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(20, 184, 166, 0.15);
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 2px 4px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-secondary::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(20, 184, 166, 0.04));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(20, 184, 166, 0.17));
    border-color: rgba(20, 184, 166, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 4px 12px rgba(20, 184, 166, 0.1);
}

.btn-secondary:hover::before {
    opacity: 1;
}

/* Range button active state */
.btn-range-active {
    position: relative;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.22), rgba(20, 184, 166, 0.3)) !important;
    color: #ffffff !important;
    border: 1px solid rgba(20, 184, 166, 0.6) !important;
    font-weight: 600 !important;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 4px 16px rgba(20, 184, 166, 0.22),
        0 2px 8px rgba(20, 184, 166, 0.16),
        0 0 20px rgba(20, 184, 166, 0.1) !important;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.btn-range-active::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.07) 50%,
        transparent 70%
    );
    animation: shimmer 3s infinite;
    pointer-events: none;
    z-index: 1;
}

/* Input Fields */
.input-field {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #f8fafc;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-teal);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.input-field::placeholder {
    color: rgba(248, 250, 252, 0.6);
}

/* Fix for select.input-field on Windows - white text on white background in dropdown */
select.input-field {
    background: #1e293b !important;
    color: #f8fafc !important;
    color-scheme: dark;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
select.input-field option {
    background: #1e293b !important;
    color: #f8fafc !important;
}

/* Fix for select elements on Windows - ensure readable text */
select.btn-secondary {
    background: linear-gradient(135deg, rgba(29, 30, 31, 0.9), rgba(29, 30, 31, 0.95)) !important;
    color: rgba(248, 250, 252, 0.95) !important;
    border: 1px solid rgba(20, 184, 166, 0.15) !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

select.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(20, 184, 166, 0.2)) !important;
    color: #ffffff !important;
}

select.btn-secondary:focus {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(20, 184, 166, 0.17)) !important;
    color: #ffffff !important;
    border-color: rgba(20, 184, 166, 0.4) !important;
    outline: none;
}

/* Fix for option elements - ensure dark background and light text on Windows */
select.btn-secondary option {
    background: rgba(29, 30, 31, 0.95) !important;
    color: rgba(248, 250, 252, 0.95) !important;
    padding: 8px 12px;
}

select.btn-secondary option:hover,
select.btn-secondary option:checked {
    background: rgba(20, 184, 166, 0.3) !important;
    color: #ffffff !important;
}

/* Text Colors */
.text-primary { color: var(--primary-teal); }
.text-secondary { color: #cbd5e1; }
.text-muted { color: #94a3b8; }
.text-accent { color: var(--accent-teal); }

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

/* Domyślny scrollbar dla elementów wewnątrz */
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

/* Główny scrollbar strony (musi być po ogólnym lub z !important) */
body::-webkit-scrollbar-track {
    background: #1f2828 !important;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-teal), var(--accent-teal));
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-teal), var(--primary-teal));
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   ANIMATION SYSTEM - Professional UX/UI
   ============================================ */

/* Respect user preferences for reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Performance: Disable complex effects for slow devices via JS class */
body.slow-device .glass,
body.slow-device .glass-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.slow-device *,
body.slow-device *::before,
body.slow-device *::after {
    animation-duration: 0ms !important;
    transition-duration: 0.1s !important;
}

body.slow-device .float-animation {
    animation: none !important;
}

/* Core Animation Keyframes */
@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 fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

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

/* Animation Classes */
.anim-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.anim-fade-in-down {
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.anim-fade-in-left {
    animation: fadeInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.anim-fade-in-right {
    animation: fadeInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.anim-fade-in-scale {
    animation: fadeInScale 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.anim-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 0;
}

.anim-slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* Stagger delays - for grid items (max 6 to prevent long delays) */
.anim-delay-1 { animation-delay: 0.05s; }
.anim-delay-2 { animation-delay: 0.10s; }
.anim-delay-3 { animation-delay: 0.15s; }
.anim-delay-4 { animation-delay: 0.20s; }
.anim-delay-5 { animation-delay: 0.25s; }
.anim-delay-6 { animation-delay: 0.30s; }

/* Sequential delays - for timeline elements */
.anim-delay-100 { animation-delay: 0.1s; }
.anim-delay-150 { animation-delay: 0.15s; }
.anim-delay-200 { animation-delay: 0.2s; }
.anim-delay-250 { animation-delay: 0.25s; }
.anim-delay-300 { animation-delay: 0.3s; }
.anim-delay-400 { animation-delay: 0.4s; }
.anim-delay-500 { animation-delay: 0.5s; }
.anim-delay-600 { animation-delay: 0.6s; }

/* Enhanced transitions for interactive elements */
.glass-card,
.btn-primary,
.btn-secondary,
.input-field {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth hover states */
a, button {
    transition: all 0.2s ease-out;
}

/* Page load animation for header */
header {
    animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Enhanced Model Selection Tiles */
.model-tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem;
    justify-items: center;
    max-width: 600px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .model-tiles-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .model-tiles-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .model-tiles-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.model-tile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-width: 100px;
    min-height: 120px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.model-tile {
    position: relative;
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: rgba(30, 34, 38, 0.85);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.model-tile:hover {
    background: rgba(30, 34, 38, 0.9);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.model-tile.selected {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(20, 184, 166, 0.24));
    border: 2px solid rgba(20, 184, 166, 0.6);
    box-shadow:
        0 8px 24px rgba(20, 184, 166, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.model-tile.selected::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(20, 184, 166, 0.14));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.model-tile.selected::after {
    display: none;
}

@keyframes checkmarkAppear {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.model-logo {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.model-tile.selected .model-logo {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(20, 184, 166, 0.18));
}

.model-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #cbd5e1;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
    line-height: 1.2;
    margin: 0 auto;
    display: block;
    position: relative;
    left: 0;
    right: 0;
}

.model-tile.selected + .model-name {
    color: var(--primary-teal);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(20, 184, 166, 0.2);
}

.model-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .model-tiles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
        max-width: 400px;
    }
    .model-tile {
        width: 3.5rem;
        height: 3.5rem;
        padding: 0.5rem;
    }
    .model-logo {
        width: 2rem;
        height: 2rem;
    }
    .model-name {
        font-size: 0.75rem;
        width: 100%;
    }
    .model-tile-container {
        min-width: 100px;
        min-height: 120px;
    }
}

@media (max-width: 480px) {
    .model-tiles-grid {
        gap: 1.25rem;
    }
}

/* Global calendar arrow icons styling - unified across all calendars */
#calendarPrevMonth svg,
#calendarNextMonth svg,
#comparisonCalendarPrevMonth svg,
#comparisonCalendarNextMonth svg,
.questionComparisonCalendar1PrevMonth svg,
.questionComparisonCalendar1NextMonth svg,
.questionComparisonCalendar2PrevMonth svg,
.questionComparisonCalendar2NextMonth svg {
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem !important;
    min-height: 1rem !important;
    stroke-width: 2 !important;
    stroke: currentColor !important;
    fill: none !important;
}

#calendarPrevMonth svg path,
#calendarNextMonth svg path,
#comparisonCalendarPrevMonth svg path,
#comparisonCalendarNextMonth svg path,
.questionComparisonCalendar1PrevMonth svg path,
.questionComparisonCalendar1NextMonth svg path,
.questionComparisonCalendar2PrevMonth svg path,
.questionComparisonCalendar2NextMonth svg path {
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}
