@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --app-height: 100dvh;
    --orange-400: #fb923c;
    --blue-300: #93c5fd;
    --green-300: #86efac;
    --purple-300: #d8b4fe;
    --yellow-300: #fde047;
    --slate-300: #cbd5e1;
    --red-300: #f87171;
    
    /* Default Theme */
    --app-bg-gradient-linear: linear-gradient(180deg, #ffffff 0%, #f1f0f0 100%);
    --app-bg-gradient-radial: radial-gradient(ellipse at 50% 0%, rgba(145, 145, 145, 0.1) 0%, transparent 80%);
    --app-bg-solid: #f1f0f0;
    --accent-color: #cc0000;
    
}

body.theme-fiolet {
    --app-bg-gradient-linear: linear-gradient(180deg, #2D1B69 0%, #0D0221 100%);
    --app-bg-gradient-radial: radial-gradient(ellipse at 50% 0%, rgba(109, 40, 217, 0.45) 10%, transparent 55%);
    --app-bg-solid: #0D0221;
    --accent-color: #8a56de;
}

body.theme-blue {
    --app-bg-gradient-linear: linear-gradient(180deg, #4c66b2 0%, #0b287c 100%);
    --app-bg-gradient-radial: radial-gradient(ellipse at 50% 0%, rgba(148, 163, 184, 0.45) 0%, transparent 55%);
    --app-bg-solid: #0b287c;
    --accent-color: #5574ca;
}

body.theme-green {
    --app-bg-gradient-linear: linear-gradient(180deg, #087659 0%, #022C22 100%);
    --app-bg-gradient-radial: radial-gradient(ellipse at 50% 0%, rgba(148, 163, 184, 0.45) 0%, transparent 55%);
    --app-bg-solid: #022C22;
    --accent-color: #087659;
}

body.theme-yellow {
    --app-bg-gradient-linear: linear-gradient(180deg, #e7b263 0%, #f3a022 100%);
    --app-bg-gradient-radial: radial-gradient(ellipse at 50% 0%, rgb(233 183 110) 0%, transparent 55%);
    --app-bg-solid: #f3a022;
    --accent-color: #600000;
    color-scheme: light;
}

body.theme-red {
    --app-bg-gradient-linear: linear-gradient(180deg, #a90101 0%, #450A0A 100%);
    --app-bg-gradient-radial: radial-gradient(ellipse at 50% 0%, rgba(255, 193, 7, 0.45) 0%, transparent 55%);
    --app-bg-solid: #450A0A;
    --accent-color: #a90101;    
}

body.theme-slate {
    --app-bg-gradient-linear: linear-gradient(180deg, #576f92 0%, #0F172A 100%);
    --app-bg-gradient-radial: radial-gradient(ellipse at 50% 0%, rgba(148, 163, 184, 0.45) 0%, transparent 55%);
    --app-bg-solid: #0F172A;
    --accent-color: #334155;
}

body.theme-white {
    --app-bg-gradient-linear: linear-gradient(180deg, #ffffff 0%, #f1f0f0 100%);
    --app-bg-gradient-radial: radial-gradient(ellipse at 50% 0%, rgba(145, 145, 145, 0.1) 0%, transparent 80%);
    --app-bg-solid: #f1f0f0;
    --accent-color: #cc0000;
    color-scheme: light;
}

body {
    height: var(--app-height);
    min-height: -webkit-fill-available;
    margin: 0;
    overflow: hidden;
    background: var(--app-bg-gradient-radial);
    background-color: var(--app-bg-solid);
    display: flex;
    flex-direction: column; 
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', sans-serif;
    color: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.8s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   WHITE THEME OVERRIDES
   ============================================ */
body.theme-white {
    color: #1a1a1a;
}

body.theme-white html {
    background-color: #f5f5f5 !important;
}

/* Cards - glass effect on white bg */
body.theme-white .glass-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body.theme-white .glass-card:active {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(204, 0, 0, 0.3);
}

body.theme-white .card-title {
    color: #1a1a1a;
}

body.theme-white .card-subtitle {
    color: rgba(0, 0, 0, 0.5);
}

/* Buttons */
body.theme-white .icon-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.theme-white .icon-btn:hover {
    background: rgba(204, 0, 0, 0.08);
    border-color: rgba(204, 0, 0, 0.3);
    color: #cc0000;
}

body.theme-white .btn-outline {
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.2);
}

body.theme-white .btn-outline:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
}

body.theme-white .btn-primary {
    background: #cc0000;
    color: white;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.3);
}

body.theme-white .btn-primary:hover {
    background: #aa0000;
}

/* View title */
body.theme-white .view-title {
    background: linear-gradient(to bottom, #1a1a1a, #444444);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

/* Form elements */
body.theme-white .form-label {
    color: rgba(0, 0, 0, 0.8);
}

body.theme-white .form-helper {
    color: rgba(0, 0, 0, 0.5);
}

body.theme-white .form-input {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
}

body.theme-white .form-input:focus {
    border-color: #cc0000;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(204, 0, 0, 0.15);
}

body.theme-white .form-input::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

body.theme-white .select-wrapper select option {
    background-color: #ffffff;
    color: #1a1a1a;
}

/* Toggle Switch */
body.theme-white .toggle-slider {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Divider */
body.theme-white .divider {
    background: rgba(0, 0, 0, 0.1);
}

/* Scrollbar */
body.theme-white .scrollable-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

body.theme-white .scrollable-panel::-webkit-scrollbar-thumb {
    background: rgba(204, 0, 0, 0.3);
}

/* Calendar items */
body.theme-white .meeting-label {
    color: rgba(0, 0, 0, 0.5);
}

body.theme-white .meeting-date {
    color: #1a1a1a;
}

body.theme-white .past-meeting {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.03);
}

body.theme-white .past-meeting .meeting-date {
    color: rgba(0, 0, 0, 0.5);
}

body.theme-white .next-meeting {
    border: 1px solid rgba(204, 0, 0, 0.4);
    background: rgba(204, 0, 0, 0.07);
}

body.theme-white .next-badge {
    background: #cc0000;
    color: white;
}

body.theme-white .bierzmowanie-card {
    border-color: rgba(204, 0, 0, 0.35);
    background: rgba(204, 0, 0, 0.05);
}

body.theme-white .bierzmowanie-card .meeting-label {
    color: #cc0000;
}

/* Announcements */
body.theme-white .announcement-content {
    color: rgba(0, 0, 0, 0.85);
}

body.theme-white .announcement-content b,
body.theme-white .announcement-content strong {
    color: #1a1a1a;
}

body.theme-white .announcement-content a {
    color: #cc0000;
}

/* Dary tabs */
body.theme-white .dary-tabs-nav {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body.theme-white .dary-tab {
    color: rgba(0, 0, 0, 0.4);
}

body.theme-white .dary-tab.active {
    background: #cc0000;
    color: white;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.3);
}

body.theme-white .gift-detail-card {
    background: rgba(255, 255, 255, 0.9);
}

body.theme-white .gift-points-list li,
body.theme-white .gift-questions-list li {
    color: rgba(0, 0, 0, 0.85);
}

body.theme-white .gift-points-list li::before,
body.theme-white .gift-questions-list li::before {
    color: #cc0000;
}

/* Quiz */
body.theme-white .quiz-question {
    color: #1a1a1a;
}

body.theme-white .quiz-option {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
}

body.theme-white .quiz-option:hover {
    background: rgba(204, 0, 0, 0.06);
    border-color: rgba(204, 0, 0, 0.3);
}

body.theme-white .quiz-explanation {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.04);
    border-left-color: #cc0000;
}

body.theme-white .loading-card,
body.theme-white .error-card {
    color: rgba(0, 0, 0, 0.5);
}

/* Chat */
body.theme-white .assistant-msg {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

body.theme-white .chat-input-area {
    border-top-color: rgba(0, 0, 0, 0.1);
}

body.theme-white #chat-input {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
}

body.theme-white #chat-input:focus {
    border-color: #cc0000;
}

body.theme-white #chat-input::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

body.theme-white .send-btn {
    background: #cc0000;
    color: white;
}

body.theme-white .typing-indicator {
    color: rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.05);
}

/* Policy */
body.theme-white .policy-content {
    color: rgba(0, 0, 0, 0.85);
}

body.theme-white .policy-content h3 {
    color: #1a1a1a;
}

body.theme-white .policy-content h4 {
    color: #cc0000;
}

/* PWA Install overlay */
body.theme-white .pwa-install-subtitle {
    color: rgba(0, 0, 0, 0.6);
}

body.theme-white .pwa-instruction-section {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body.theme-white .pwa-instruction-title {
    color: #cc0000;
}

body.theme-white .pwa-steps {
    color: rgba(0, 0, 0, 0.75);
}

/* Connectivity overlay */
body.theme-white .connectivity-text {
    color: rgba(0, 0, 0, 0.65);
}

/* Laps count */
body.theme-white #total-laps-count {
    color: #cc0000;
}

/* Decor blobs slightly dimmer on white */
body.theme-white .decor-blob-1,
body.theme-white .decor-blob-2 {
    opacity: 0.08;
    background-color: #cc0000;
}

/* Active glow on white */
body.theme-white .active-glow {
    border-color: rgba(204, 0, 0, 0.4);
    background: rgba(204, 0, 0, 0.05);
    box-shadow: 0 0 20px rgba(204, 0, 0, 0.12);
}

/* Privacy button fix - inline styles with white rgba are invisible on white bg */
body.theme-white #privacy-btn {
    background: rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    color: #333333 !important;
    opacity: 1 !important;
}

body.theme-white #instrPliki1 {
    background: rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    color: #333333 !important;
    opacity: 1 !important;
}

body.theme-white #instrPliki2 {
    background: rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    color: #333333 !important;
    opacity: 1 !important;
}

body.theme-white #privacy-btn:hover {
    background: rgba(204, 0, 0, 0.08) !important;
    border-color: rgba(204, 0, 0, 0.3) !important;
    color: #cc0000 !important;
}

/* html background for white theme */
body.theme-white ~ html,
html:has(body.theme-white) {
    background-color: #f5f5f5 !important;
}

/* Quiz buttons fix - white background makes default white button invisible */
body.theme-white .quiz-next-btn {
    background: #cc0000;
    color: #ffffff;
    border: none;
}

body.theme-white .quiz-next-btn:active {
    background: #aa0000;
}

/* btn-outline inside quiz summary - niebieski i czarny 
body.theme-white .quiz-next-btn.btn-outline {
    background: transparent;
    color: #1e3a8a;
    border: 2px solid #1e3a8a;
}

body.theme-white .quiz-next-btn.btn-outline:hover {
    background: rgba(30, 58, 138, 0.08);
}
*/
/* Ikonka nagrody (award) w podsumowaniu - czerwona 
body.theme-white .quiz-summary .text-yellow {
    color: #cc0000 !important;
}

/* Quiz summary card 
body.theme-white .quiz-summary {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
}
*/
body.theme-white .quiz-summary p {
    color: rgba(0, 0, 0, 0.7);
}

/* Summary score - niebieski */
body.theme-white .summary-score {
    color: #1e3a8a;
}

body.bg-solid {
    background: var(--app-bg-solid) !important;
}
body.bg-solid .bg-decor {
    display: none;
}

body.bg-linear {
    background: var(--app-bg-gradient-linear) !important;
}

body.bg-radial {
    background: var(--app-bg-gradient-radial), var(--app-bg-solid) !important;
    background-attachment: fixed;
}


html {
    background-color: black !important; /* Hide potential flashes */
    height: -webkit-fill-available;
    overscroll-behavior: none;
    position: fixed;
    width: 100%;
    height: 100%;
}

@supports (-webkit-touch-callout: none) {
  .main-container {
    height: -webkit-fill-available;
  }
  body {
    min-height: -webkit-fill-available;
  }
}

/* Background Decoration */
.bg-decor {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    overflow: hidden;
    pointer-events: none;
}
.decor-blob-1 {
    position: absolute;
    top: -10%; left: -10%;
    width: 40%; height: 40%;
    background-color: var(--accent-color);
    opacity: 0.15;
    filter: blur(120px);
    border-radius: 9999px;
}
.decor-blob-2 {
    position: absolute;
    bottom: -10%; right: -10%;
    width: 40%; height: 40%;
    background-color: var(--accent-color);
    opacity: 0.1;
    filter: blur(120px);
    border-radius: 9999px;
}

/* Main Container */
.main-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 28rem; /* 448px */
    margin-left: auto;
    margin-right: auto;
    position: relative;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: 10px; /* Zredukowany padding na dole */
    box-sizing: border-box;
}

.menu-icon {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
    display: block;
}
/* Header */
.header {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 1rem;
}
.header img {
    height: 4rem;
    width: auto;
    object-fit: contain;
}

/* Main Grid */
.grid-main {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    grid-auto-rows: minmax(0, 1fr);
    min-height: 0;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Glassmorphism Card Override/Additions */
.glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateZ(0); /* Hardware acceleration hint */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.5rem;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem;
    position: relative;
    box-shadow: 0 8px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.glass-card:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.active-glow {
    border-color: rgba(249, 115, 22, 0.5);
    background: rgba(249, 115, 22, 0.05);
    box-shadow: 0 0 25px rgba(249, 115, 22, 0.15), inset 0 0 15px rgba(249, 115, 22, 0.1);
}

.text-glow {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    margin: 2px;
    font-size: 12px;
}

/* Icons Inside Cards */
.icon-box {
    padding: 0;
    border-radius: 1rem;
    margin: 0;
}
.icon-box-orange {
    background-color: rgba(249, 115, 22, 0.2);
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.2);
}
.icon-box-blue {
    background-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}
.icon-box-green {
    background-color: rgba(34, 197, 94, 0.2);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.1);
}
.icon-box-purple {
    background-color: rgba(168, 85, 247, 0.2);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.1);
}
.icon-box-yellow {
    background-color: rgba(234, 179, 8, 0.2);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.1);
}
.icon-box-slate {
    background-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 0 15px rgba(148, 163, 184, 0.1);
}

.icon {
    width: 1.75rem;
    height: 1.75rem;
}
.text-orange { color: var(--orange-400); }
.text-blue { color: var(--blue-300); }
.text-green { color: var(--green-300); }
.text-purple { color: var(--purple-300); }
.text-yellow { color: var(--yellow-300); }
.text-slate { color: var(--slate-300); }

/* Card Text */
.card-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    margin: 0;
}
.card-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    margin-top: 0.25rem;
    margin-bottom: 0;
    font-weight: 500;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    opacity: 0; /* Ensures it starts invisible */
    animation: fadeIn 0.5s ease-out forwards;
}



/* Settings View */
.settings-view {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
    min-height: 0; /* Allow inner scrolling */
    overflow: hidden;
    will-change: transform, opacity;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0 0.5rem 0;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.icon-btn i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-btn:hover i {
    transform: translateX(-3px);
}

.icon-btn:active {
    transform: scale(0.92);
}

.view-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: white;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: linear-gradient(to bottom, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-spacer {
    width: 2.75rem;
}

.settings-panel {
    align-items: stretch; /* override glass-card center align */
    justify-content: flex-start; /* Ensure content starts at top */
    text-align: left;
    gap: 1.25rem;
    padding-top: 1.5rem; /* Add internal padding top */
}

.scrollable-panel {
    flex: 1;
    overflow-y: auto;
    /* overflow-x: hidden; */
    display: flex !important;
    flex-direction: column;
    padding-right: 0.75rem;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    cursor: default;
    overscroll-behavior-y: contain;
    min-height: 0;
    will-change: scroll-position;
    transform: translateZ(0);
    padding-bottom: 2rem;
}

.scrollable-panel:active {
    transform: none !important;
}

/* Custom scrollbar for premium look */
.scrollable-panel::-webkit-scrollbar {
    width: 4px;
}
.scrollable-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}
.scrollable-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.policy-content {
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    user-select: text; /* Allow users to copy text */
    -webkit-user-select: text;
}

.policy-content h3 {
    font-size: 1.1rem;
    margin-top: 0;
    color: white;
}

.policy-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--blue-300);
    font-weight: 600;
}

.policy-content p {
    margin-bottom: 1rem;
}

.policy-content ul {
    margin-bottom: 1rem;
    padding-left: 1.25rem;
}

.policy-content li {
    margin-bottom: 0.5rem;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.form-group-inline {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.mb-0 {
    margin-bottom: 0;
}

.form-helper {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-top: 0.1rem;
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Select element styling */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.5rem;
    cursor: pointer;
}

.select-wrapper select option {
    background-color: var(--slate-300); /* For standard dropdowns */
    color: #1e293b;
}

.select-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 1.25rem;
    height: 1.25rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .3s;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background-color: rgba(34, 197, 94, 0.6); /* Green */
    border-color: rgba(34, 197, 94, 0.4);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px rgba(34, 197, 94, 0.6);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.btn-outline:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.1);
}

.w-full {
    width: 100%;
}

.gap-2 {
    gap: 0.5rem;
}

.icon-sm {
    width: 1rem;
    height: 1rem;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* QR Code Container Refinements */
#qrcode {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: white !important;
}

#qrcode canvas, #qrcode img {
    border-radius: 8px;
}

.qr-container p {
    margin-bottom: 0;
}

/* Chat AI Styles */
.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    align-items: stretch;
    text-align: left;
    overflow: hidden;
    height: 75vh; /* Zwiększono z 60vh */
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.chat-messages::-webkit-scrollbar {
    width: 3px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: messageFadeIn 0.3s ease-out forwards;
}

@keyframes messageFadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.assistant-msg {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-msg {
    align-self: flex-end;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-bottom-right-radius: 0.25rem;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.typing-indicator {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    align-self: flex-start;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.chat-input-area {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#chat-input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s;
}
#chat-input:focus {
    border-color: var(--purple-300);
}

.send-btn {
    background: var(--purple-300);
    color: #4c1d95;
    border: none;
    border-radius: 1rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.send-btn:active {
    transform: scale(0.9);
    filter: brightness(1.1);
}
.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
    width: 100%;
}

/* Calendar Styles */
.calendar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding: 0.5rem 0.5rem 2rem 0.5rem;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    align-items: center; /* wyśrodkowanie kart */
}

.calendar-container::-webkit-scrollbar {
    width: 4px;
}
.calendar-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.calendar-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    text-align: left;
    gap: 1rem;
    width: 100%;
    max-width: 26rem;
    box-sizing: border-box;
}

.meeting-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meeting-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meeting-date {
    font-size: 0.9375rem;
    font-weight: 600;
}

.meeting-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}



.past-meeting {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.04);
}

.past-meeting .meeting-date {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.6);
}

.bierzmowanie-card {
    border: 1px solid rgba(253, 224, 71, 0.3);
    background: rgba(253, 224, 71, 0.05);
}

.bierzmowanie-card .meeting-label {
    color: var(--yellow-300);
}

.next-meeting {
    border: 1px solid rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.1);
    transform: scale(1.02);
}

.next-badge {
    background: var(--purple-300);
    color: #4c1d95;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 800;
}

.text-purple { color: var(--purple-300); }
.text-red { color: var(--red-300); }

.loading-card, .error-card {
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Announcement specific styles */
.announcement-item {
    align-items: stretch;
    text-align: left;
    cursor: default;
    padding: 1.5rem;
}

.announcement-item:active {
    transform: none; /* No scaling for announcement cards */
}

.announcement-content {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.announcement-content b, .announcement-content strong {
    color: white;
    font-weight: 700;
}

.announcement-content a {
    color: var(--blue-300);
    text-decoration: underline;
}

/* Dary / Gifts Styles */
.gift-item {
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 1.25rem;
    text-align: left;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
    cursor: default;
}

.gift-item:active {
    transform: none;
}

.gift-icon-box {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--orange-400);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.orange-glow {
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.2);
    border-color: rgba(249, 115, 22, 0.3);
}

.gift-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.gift-content h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.gift-content p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.7);
}

/* Dary View Custom Styles */
.dary-tabs-nav {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dary-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dary-tab.active {
    background: #d10404;
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.gift-detail-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gift-detail-card {
    flex-grow: 1;
    padding: 1.5rem;
    align-items: flex-start;
    text-align: left;
    gap: 1.25rem;
    justify-content: flex-start;
}

.gift-card-header, .gift-questions-header {
    display: inline-flex;
    align-items: center;
    background: white;
    color: #4c1d95; /* Match assistant color */
    border-radius: 12px;
    padding: 8px 16px;
    font-weight: 700;
    margin-bottom: 0.75rem;
    width: 90%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gift-header-icon {
    color: #d80027;
    font-size: 1.5rem;
    margin-right: 12px;
    width: 1.5rem;
    object-fit: contain;
    display: inline-block;
}

.gift-header-text {
    font-size: 0.9rem;
    line-height: 1.2;
}

.gift-points-list, .gift-questions-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    width: 100%;
}

.gift-points-list li, .gift-questions-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
}

.gift-points-list li::before, .gift-questions-list li::before {
    content: "◆";
    position: absolute;
    left: 0;
    color: white;
    font-size: 0.8rem;
    top: 2px;
}

.gift-questions-header {
    margin-top: 1rem;
}

.header-icon-q {
    font-family: serif;
    font-weight: 900;
    font-size: 1.8rem;
}
/* Quiz / wyzwanie Styles */
.quiz-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.quiz-card {
    text-align: left;
    align-items: stretch;
    padding: 1.5rem;
    gap: 1.25rem;
    cursor: default;
}

.quiz-question {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: white;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1rem;
}

.quiz-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.quiz-option.correct {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
}

.quiz-option.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.quiz-feedback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.reward-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.quiz-explanation {
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 3px solid var(--blue-300);
}

.quiz-next-btn {
    margin-top: 1rem;
    background: #ffffff;
    color: #1e3a8a;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.quiz-next-btn:active {
    transform: scale(0.95);
}

.quiz-summary {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.summary-score {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--yellow-300);
}

.laps-summary-card {
    flex-direction: row;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    cursor: default;
    background: rgba(255, 255, 255, 0.04);
}

.laps-summary-card:active {
    transform: none;
}

.laps-count-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#total-laps-count {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--orange-400);
}

.quiz-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

/* Connectivity Overlay */

.connectivity-card {
    max-width: 300px;
    width: 100%;
    cursor: default;
}

.connectivity-card:active {
    transform: none;
}

.connectivity-text {
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.connectivity-loader {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}


/* PWA Install Overlay Styles */
.pwa-install-card {
    max-width: 90%;
    width: 22rem;
    padding: 1.5rem;
    gap: 1.5rem;
    text-align: center;
}

.pwa-install-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.pwa-install-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.4;
}

.pwa-instructions-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    text-align: left;
}

.pwa-instruction-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pwa-instruction-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--purple-300);
}

.pwa-steps {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pwa-steps li {
    line-height: 1.4;
}

.icon-inline {
    width: 1rem;
    height: 1rem;
    vertical-align: middle;
    display: inline-block;
    opacity: 0.8;
}

.mt-4 {
    margin-top: 1rem;
}

/* Connectivity & PWA Overlays Shared */
.connectivity-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}