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

:root {
    /* === Liquid Glass Palette (iOS 26 inspired) === */
    --primary-color: #10B981;
    --primary-hover: #059669;
    --accent-color: #3B82F6;
    --accent-hover: #2563EB;
    
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.82);
    --glass-blur: blur(25px);

    /* Original Dark Palette kept for fallback/text */
    --bg-color: #050706;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Premium Avatar Gradients */
    --grad-1: linear-gradient(135deg, #FF6B6B, #FF8E53);
    --grad-2: linear-gradient(135deg, #4facfe, #00f2fe);
    --grad-3: linear-gradient(135deg, #43e97b, #38f9d7);
    --grad-4: linear-gradient(135deg, #fa709a, #fee140);
    --grad-5: linear-gradient(135deg, #667eea, #764ba2);
    --grad-6: linear-gradient(135deg, #2af598, #009efd);
    --grad-7: linear-gradient(135deg, #b721ff, #21d4fd);
    --grad-8: linear-gradient(135deg, #f093fb, #f5576c);
}

[data-theme="light"] {
    --bg-color: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(0, 0, 0, 0.12);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --glass-blur: blur(15px);
    
    --card-hover-bg: rgba(255, 255, 255, 0.85);
    --input-bg: rgba(255, 255, 255, 0.8);
    --nav-bg: rgba(255, 255, 255, 0.7);
}

:root:not([data-theme="light"]) {
    --card-hover-bg: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.04);
    --nav-bg: rgba(0, 0, 0, 0.2);
}

/* Reset a základ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, hsla(161, 84%, 39%, 0.15) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(217, 91%, 60%, 0.15) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 0.15) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Blobs for Liquid Effect */
body::before, body::after {
    content: "";
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.2;
    pointer-events: none;
    animation: liquid 25s infinite alternate;
}

body::before {
    background: var(--primary-color);
    top: -100px;
    left: -100px;
}

body::after {
    background: var(--accent-color);
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes liquid {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, 50px) scale(1.1); }
    66% { transform: translate(-50px, 150px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Typografie */
h1, h2, h3, h4, h5 { font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.875rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; color: var(--text-secondary); }
p { margin-bottom: 1rem; color: var(--text-secondary); }
.text-center { text-align: center; }

/* Obálka pro celou aplikaci */
.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
    position: relative;
}

/* Hlavička a navigace */
.main-header {
    background: var(--nav-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    margin-bottom: 2.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}
.logo span { opacity: 0.85; font-weight: 400; }

nav { display: flex; gap: 0.5rem; align-items: center; }
nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}
nav a:hover { color: var(--text-primary); background: rgba(0,0,0,0.05); }
nav a.active { color: var(--primary-color); background: rgba(16, 185, 129, 0.1); }

[data-theme="dark"] nav a { color: rgba(255,255,255,0.7); }
[data-theme="dark"] nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
[data-theme="dark"] nav a.active { color: #fff; background: rgba(255,255,255,0.15); }

/* Typografie */
h1, h2, h3, h4, h5 { font-family: 'Outfit', sans-serif; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
h1 { font-size: 2.2rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.6rem; margin-bottom: 1rem; color: var(--text-primary); }
p { margin-bottom: 1rem; color: var(--text-secondary); }

/* Komponenty: Karty */
.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 2rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-6px) scale(1.01);
    background: var(--card-hover-bg);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.45);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

/* Badges / Štítky */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}
.badge-primary { background: rgba(16, 185, 129, 0.2); color: #34D399; border-color: rgba(16, 185, 129, 0.3); }
.badge-secondary { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
.badge-success { background: rgba(34, 197, 94, 0.15); color: #4ADE80; border-color: rgba(34, 197, 94, 0.3); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: #60A5FA; border-color: rgba(59, 130, 246, 0.3); }
.badge-pending { background: rgba(251, 191, 36, 0.15); color: #FBBF24; border-color: rgba(251, 191, 36, 0.3); }
.badge-accepted { background: rgba(16, 185, 129, 0.15); color: #34D399; border-color: rgba(16, 185, 129, 0.3); }
.badge-declined { background: rgba(244, 63, 94, 0.15); color: #FB7185; border-color: rgba(244, 63, 94, 0.3); }

/* Avatary a iniciály */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.15);
    background-size: cover;
    background-position: center;
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.75rem; border-width: 1px; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; border-width: 3px; }

/* Enhanced Avatar Gradients */
.avatar-c1 { background: var(--grad-1); }
.avatar-c2 { background: var(--grad-2); }
.avatar-c3 { background: var(--grad-3); }
.avatar-c4 { background: var(--grad-4); }
.avatar-c5 { background: var(--grad-5); }
.avatar-c6 { background: var(--grad-6); }
.avatar-c7 { background: var(--grad-7); }
.avatar-c8 { background: var(--grad-8); }
.avatar-c9 { background: var(--grad-1); filter: hue-rotate(90deg); }
.avatar-c10 { background: var(--grad-2); filter: hue-rotate(180deg); }

/* Dynamické štítky kategorií */
.badge-category {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}
.badge-category:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* Tlačítka */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.6rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Outfit', sans-serif;
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; border-radius: 12px; }
.btn-block { width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, #10B981 0%, #3B82F6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    border: none;
}
.btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn-outline {
    background: var(--input-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.2);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
    background: #e11d48;
    color: white;
}

/* Formuláře */
.input-group { margin-bottom: 1.5rem; }
.input-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}
.input-group input, .input-group textarea, .input-group select {
    width: 100%;
    padding: 1.1rem 1.4rem;
    background: var(--input-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}
.input-group input:focus {
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
    outline: none;
}

/* Grid událostí */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Tabulky */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: transparent;
}
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
}
th {
    padding: 1rem 1.5rem;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
td {
    padding: 1.25rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
}
td:first-child { border-left: 1px solid rgba(255, 255, 255, 0.05); border-radius: 18px 0 0 18px; }
td:last-child { border-right: 1px solid rgba(255, 255, 255, 0.05); border-radius: 0 18px 18px 0; }
tr:hover td {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Kalendář */
.calendar-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    max-width: 360px;
    margin: 0 auto 2rem;
}
.calendar-header h3 { font-size: 1.2rem; color: #fff; }
.calendar-grid { 
    display: grid; 
    grid-template-columns: repeat(7, 1fr); 
    gap: 4px; 
}
.calendar-day-head {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.calendar-day {
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    position: relative;
    transition: all 0.2s ease;
}
.calendar-day.has-event {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(59, 130, 246, 0.4) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
}
.calendar-day.today {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}
.calendar-day.has-event:hover {
    transform: scale(1.1) translateY(-2px);
    background: var(--gradient-primary);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.5);
}

/* Utilities */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

@media (max-width: 768px) {
    .app-container { padding: 0.75rem; }
    .card { padding: 1.25rem; }
    h1 { font-size: 1.6rem; margin-bottom: 1rem; }
    h2 { font-size: 1.3rem; margin-bottom: 0.75rem; }
    
    .main-header .header-content { flex-direction: column; gap: 0.75rem; text-align: center; }
    nav { flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
    nav a { padding: 0.4rem 0.6rem; font-size: 0.9rem; }
    
    .events-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    
    /* Dashboard: Filtry na mobilu zalomit pod sebe */
    #filter-form { flex-direction: column !important; align-items: stretch !important; }
    #filter-form .input-group { min-width: 100% !important; margin-bottom: 0.5rem; }
    #filter-form .btn { width: 100%; }
    
    /* Změna horizontálních akčních tlačítek na vertikální na mobilu */
    .mobile-stack-actions { flex-direction: column; align-items: stretch !important; width: 100%; }
    .mobile-stack-actions > *, .mobile-stack-actions form { width: 100%; margin: 0; }
    .mobile-stack-actions .btn { width: 100%; justify-content: center; margin-bottom: 0.5rem; }
    
    /* Bannery událostí (Obrázky v Detailu a RSVP) */
    .mobile-banner-container { height: 160px !important; }
    .mobile-banner-title { font-size: 1.35rem !important; padding: 1rem !important; flex-wrap: wrap; gap: 0.5rem !important; }
    
    /* Úprava login/RSVP karet k maximalizaci prostoru */
    .login-container { padding: 0.5rem; max-width: 100% !important; }
    .mobile-rsvp-padding { padding: 1.25rem !important; }
    
    /* Úprava gridu kalendáře (ikdyž 480px se zalomí samo hůř bez úpravy) */
    .calendar-card { max-width: 100%; padding: 1rem; border-radius: var(--radius-md); }
    .calendar-day { font-size: 0.75rem; }
}

/* Markdown styling in descriptions */
#description-rendered {
    color: var(--text-primary);
    font-size: 1.05rem;
}
#description-rendered h1, #description-rendered h2 { color: var(--primary-color); margin-top: 1.5rem; }
#description-rendered a { color: var(--accent-color); font-weight: 600; }
#description-rendered code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-family: monospace;
}

/* Event Detail Specifics */
.event-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.info-value {
    font-weight: 500;
    font-size: 1rem;
}

.rsvp-stats-container {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.progress-multi {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    display: flex;
    overflow: hidden;
    margin-bottom: 0.75rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.guest-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.guest-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.guest-card.accepted { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); }
.guest-card.declined { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.2); }
.guest-card.pending { background: rgba(156, 163, 175, 0.05); border-color: rgba(156, 163, 175, 0.1); }

/* Bulk Actions Bar */
.bulk-actions-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1rem 2rem;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

.bulk-actions-bar.visible {
    bottom: 30px;
    opacity: 1;
}

.bulk-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.bulk-info {
    font-weight: 700;
    color: white;
    font-size: 1.1rem;
}

.bulk-info span {
    color: var(--primary-color);
}

.bulk-btns {
    display: flex;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .bulk-bar-content { flex-direction: column; gap: 1rem; text-align: center; }
    .bulk-actions-bar { width: 95%; padding: 1.5rem; }
    .bulk-btns { width: 100%; }
    .bulk-btns .btn { flex: 1; }
}
