/**
 * JRNL - Hlavní styly
 * Moderní design s glassmorphism efekty
 * Verze: 9.0 - BATCH 9: Tracker persistence (badge pro smazané trackery)
 */

/* ===== CSS RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --secondary: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --font-display: 'Playfair Display', serif;
    --font-body: 'Source Sans 3', sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 40px -20px rgb(0 0 0 / 0.15);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 50%, #fff1f2 100%);
    min-height: 100vh;
}

/* Pattern background */
.landing-page {
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(249, 115, 22, 0.1) 1px, transparent 0),
        linear-gradient(135deg, #fffbeb 0%, #fff7ed 50%, #fff1f2 100%);
    background-size: 40px 40px, 100% 100%;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== UTILITIES ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-dark {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-body);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(249, 115, 22, 0.5);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-200);
    color: var(--gray-600);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Tracker tlačítka v modalu */
.tracker-complete-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .tracker-complete-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Tracker položka v modalu */
.tracker-modal-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
}

.tracker-modal-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .tracker-modal-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.tracker-modal-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tracker-modal-icon {
    font-size: 1.5rem;
}

.tracker-modal-name {
    font-weight: 500;
}

.tracker-modal-buttons {
    display: flex;
    gap: 0.5rem;
}

.tracker-modal-note {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    font-size: 0.875rem;
    display: none;
}

.tracker-modal-note.active {
    display: block;
}

/* Tracker řádek v modalu */
.tracker-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
}

.tracker-row-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tracker-row-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

@media (min-width: 640px) {
    .tracker-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }
    
    .tracker-row-buttons {
        margin-left: 0;
    }
}

.btn-block {
    width: 100%;
}

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

/* ===== HEADER ===== */
.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* ===== HERO ===== */
.hero {
    padding: 8rem 0 5rem;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 42rem;
    margin: 0 auto 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== FEATURES ===== */
.features {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 4rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
    border-radius: var(--radius-2xl);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1.25rem;
}

.feature-icon svg {
    width: 1.75rem;
    height: 1.75rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--gray-600);
}

/* ===== CTA ===== */
.cta {
    padding: 5rem 0;
}

.cta-card {
    max-width: 48rem;
    margin: 0 auto;
    padding: 3rem;
    border-radius: var(--radius-2xl);
    text-align: center;
}

.cta-card h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.cta-card p {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
}

/* ===== FOOTER ===== */
.footer {
    padding: 2.5rem 0;
    text-align: center;
    border-top: 1px solid rgba(249, 115, 22, 0.1);
    color: var(--gray-500);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 0.5rem;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: calc(100% - 1rem);
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    background: white;
    margin: 0 auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Tablet */
@media (min-width: 640px) {
    .modal {
        padding: 2rem 1rem;
    }
    .modal-content {
        max-width: 540px;
        padding: 1.5rem;
        border-radius: var(--radius-2xl);
    }
}

/* Desktop */
@media (min-width: 768px) {
    .modal-content {
        max-width: 640px;
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .modal-content {
        max-width: 720px;
    }
}

@media (min-width: 1280px) {
    .modal-content {
        max-width: 800px;
    }
}

/* Větší modaly (pro editaci zápisů) */
.modal-content.modal-lg {
    max-width: calc(100% - 1rem);
}

@media (min-width: 640px) {
    .modal-content.modal-lg {
        max-width: 600px;
    }
}

@media (min-width: 768px) {
    .modal-content.modal-lg {
        max-width: 750px;
    }
}

@media (min-width: 1024px) {
    .modal-content.modal-lg {
        max-width: 900px;
    }
}

@media (min-width: 1280px) {
    .modal-content.modal-lg {
        max-width: 1000px;
    }
}

/* Menší modaly (přihlášení, dotazy) */
.modal-content.modal-sm {
    max-width: calc(100% - 1rem);
}

@media (min-width: 640px) {
    .modal-content.modal-sm {
        max-width: 420px;
    }
}

@media (min-width: 768px) {
    .modal-content.modal-sm {
        max-width: 450px;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.modal-icon svg {
    width: 2rem;
    height: 2rem;
}

.modal-header h2 {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: var(--gray-500);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.form-error.show {
    display: block;
}

/* ===== SPINNER ===== */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ===== SUCCESS STATE ===== */
.interest-success {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: #dcfce7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
}

.success-icon svg {
    width: 2.5rem;
    height: 2.5rem;
}

.interest-success h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.interest-success p {
    color: var(--gray-500);
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

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

.slide-in {
    animation: slideIn 0.4s ease-out forwards;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero {
        padding: 6rem 0 3rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .cta-card {
        padding: 2rem;
    }
    
    .cta-card h2 {
        font-size: 1.75rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== DASHBOARD SPECIFIC ===== */
.dashboard {
    min-height: 100vh;
    padding-top: 5rem;
}

.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 0;
}

.dashboard-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

/* ===== CARDS ===== */
.card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.5rem;
}

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.stat-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ===== TABLES ===== */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
}

th {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-100);
}

tr:hover {
    background: rgba(249, 115, 22, 0.05);
}

td {
    border-bottom: 1px solid var(--gray-50);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-primary {
    background: #ffedd5;
    color: #c2410c;
}

/* ===== AVATAR ===== */
.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.avatar-lg {
    width: 5rem;
    height: 5rem;
    font-size: 2rem;
}

/* ===== CALENDAR ===== */
.calendar {
    padding: 1.5rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-nav button {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.calendar-nav button:hover {
    background: rgba(249, 115, 22, 0.1);
}

.calendar-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    padding: 0.5rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
}

.calendar-day:hover:not(:disabled) {
    background: rgba(249, 115, 22, 0.1);
}

.calendar-day.today {
    box-shadow: inset 0 0 0 2px var(--primary);
}

.calendar-day.has-entry {
    background: rgba(249, 115, 22, 0.15);
    color: var(--primary-dark);
}

.calendar-day.selected {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.calendar-day:disabled {
    color: var(--gray-300);
    cursor: not-allowed;
}

/* ===== STREAK ===== */
.streak-card {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(249, 115, 22, 0.3); }
    50% { box-shadow: 0 0 40px rgba(249, 115, 22, 0.6); }
}

.streak-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.streak-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.streak-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ===== MOOD SELECTOR ===== */
.mood-selector {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.mood-btn:hover {
    transform: scale(1.05);
}

.mood-btn.selected {
    border-color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
}

.mood-emoji {
    font-size: 2rem;
}

.mood-label {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* ===== ENTRY CARD ===== */
.entry-card {
    transition: all 0.3s ease;
}

.entry-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.entry-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.entry-mood {
    font-size: 2.5rem;
}

.entry-meta {
    flex: 1;
}

.entry-mood-label {
    font-weight: 600;
    font-size: 1.25rem;
}

.entry-lock-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.entry-lock-status svg {
    width: 1rem;
    height: 1rem;
}

.entry-lock-status.unlocked {
    color: var(--primary);
}

.entry-content {
    white-space: pre-wrap;
    line-height: 1.8;
}

.entry-images {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.entry-image {
    width: 8rem;
    height: 8rem;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

/* ===== TRACKER ===== */
.tracker-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tracker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
}

.tracker-item.completed {
    background: #dcfce7;
}

.tracker-item.incomplete {
    background: #fee2e2;
}

.tracker-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tracker-icon {
    font-size: 1.25rem;
}

.tracker-name {
    font-weight: 500;
}

.tracker-note {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-style: italic;
}

/* BATCH 9: Badge pro smazané trackery */
.tracker-deleted-badge {
    font-size: 0.625rem;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.tracker-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.tracker-status.completed {
    color: #166534;
}

.tracker-status.incomplete {
    color: #991b1b;
}

.tracker-status svg {
    width: 1rem;
    height: 1rem;
}

/* ===== MOOD INDEX ===== */
.mood-chart {
    position: relative;
    padding-left: 2.5rem;
}

.mood-chart-grid {
    position: absolute;
    inset: 0;
    left: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mood-chart-line {
    border-bottom: 1px dashed var(--gray-200);
}

.mood-chart-bars {
    height: 8rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.25rem;
}

.mood-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.mood-bar-fill {
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.25rem;
    transition: height 0.5s ease;
}

.mood-bar-emoji {
    font-size: 1rem;
}

.mood-chart-labels {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.25rem;
    margin-top: 0.5rem;
}

.mood-chart-label {
    flex: 1;
    text-align: center;
}

.mood-chart-day {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
}

.mood-chart-date {
    font-size: 0.625rem;
    color: var(--gray-400);
}

.mood-y-axis {
    position: absolute;
    left: 0;
    top: 0;
    height: 8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.875rem;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl);
    width: fit-content;
}

.tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-lg);
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    background: rgba(249, 115, 22, 0.1);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

/* ===== TOGGLE ===== */
.toggle {
    position: relative;
    width: 3.5rem;
    height: 2rem;
    border-radius: var(--radius-full);
    background: var(--gray-300);
    cursor: pointer;
    transition: background 0.2s;
}

.toggle.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.toggle-knob {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.toggle.active .toggle-knob {
    transform: translateX(1.5rem);
}

/* ===== ALERT ===== */
.alert {
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.empty-icon svg {
    width: 2.5rem;
    height: 2.5rem;
}

.empty-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-text {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ===== IMAGE UPLOAD ===== */
.image-upload-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.image-preview {
    position: relative;
    width: 6rem;
    height: 6rem;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.image-preview-remove {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Entry image wrapper for error handling */
.entry-image-wrapper {
    position: relative;
    width: 8rem;
    height: 8rem;
}

.entry-image-wrapper .entry-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1;
}

.entry-image-wrapper .entry-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.image-error-placeholder {
    display: none;
    width: 100%;
    height: 100%;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.image-error-placeholder svg {
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.5rem;
}

.image-error-placeholder span {
    font-size: 0.625rem;
    text-align: center;
}

.entry-image-wrapper.image-error .image-error-placeholder {
    display: flex;
}

.image-upload-btn {
    width: 6rem;
    height: 6rem;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.image-upload-btn:hover {
    border-color: var(--primary);
}

.image-upload-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--gray-400);
}

/* ===== LAYOUT ===== */
.page-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

@media (min-width: 1024px) {
    .page-layout {
        grid-template-columns: 320px 1fr;
    }
    
    .sidebar {
        position: sticky;
        top: 6rem;
        align-self: start;
    }
}

.main-content {
    min-width: 0;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
}

/* ===== ICONS ===== */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

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

.icon-lg svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* ===== HEADER ICON BUTTONS (SVG) ===== */
.header-icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--primary);
}

.header-icon-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: var(--primary);
    flex-shrink: 0;
}

.header-icon-btn:hover {
    background: rgba(249, 115, 22, 0.15);
    transform: scale(1.05);
}

.header-icon-btn:hover svg {
    stroke: var(--secondary);
}

/* Logout button styling */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
}

.btn-logout .logout-icon {
    width: 1.125rem;
    height: 1.125rem;
}

.btn-logout .logout-text {
    display: none;
}

@media (min-width: 768px) {
    .btn-logout .logout-text {
        display: inline;
    }
}

/* ===== ACTION BUTTONS ===== */
.action-btn {
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--gray-500);
}

.action-btn:hover {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
}

.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ===== FLEX UTILITIES ===== */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* ===== MARGIN/PADDING UTILITIES ===== */
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

/* ===== TEXT UTILITIES ===== */
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-gray { color: var(--gray-500); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ===== WIDTH UTILITIES ===== */
.w-full { width: 100%; }

/* Width classes */
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }

/* Height classes */
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }

/* Min/Max width */
.min-w-0 { min-width: 0; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }

/* ===== VISIBILITY ===== */
.hidden { display: none !important; }

@media (max-width: 768px) {
    .md-hidden { display: none !important; }
}

@media (min-width: 769px) {
    .md-show { display: block !important; }
}
/* 
 * JRNL - CSS Opravy (přidat na konec style.css)
 * Oprava ikon pro Safari a Chrome
 */

/* Oprava velikosti SVG ikon v action-btn */
.action-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Větší ikony v headeru */
.header-content .action-btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Oprava pro Safari - explicitní display */
.action-btn {
    display: inline-flex;
}

/* SVG ikony obecně */
svg {
    display: inline-block;
    vertical-align: middle;
}

/* Ikony v tlačítkách */
.btn svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Streak ikona */
.streak-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Calendar navigation */
.calendar-nav svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Entry lock status */
.entry-lock-status svg {
    width: 1rem;
    height: 1rem;
}

/* SVG in flex containers with size classes */
.w-4.h-4, svg.w-4.h-4 { width: 1rem !important; height: 1rem !important; }
.w-5.h-5, svg.w-5.h-5 { width: 1.25rem !important; height: 1.25rem !important; }
.w-6.h-6, svg.w-6.h-6 { width: 1.5rem !important; height: 1.5rem !important; }

/* Card section icons */
.card .flex.items-center.gap-3 > svg:first-child {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Toggle switch */
.toggle {
    width: 3rem;
    height: 1.75rem;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.toggle-knob {
    width: 1.25rem;
    height: 1.25rem;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle.active .toggle-knob {
    transform: translateX(1.25rem);
}

/* Flex utilities */
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* ===== DOPLNĚNÉ UTILITY (kompletace neúplného systému) ===== */
/* Display */
.block { display: block; }
.grid { display: grid; }

/* Align */
.items-start { align-items: flex-start; }
.text-left { text-align: left; }

/* Spacing – navazuje na škálu 0.25rem */
.mt-1 { margin-top: 0.25rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-3 { margin-bottom: 0.75rem; }
.p-3 { padding: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Text size */
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

/* Height */
.h-full { height: 100%; }


/* ===== LIGHTBOX ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 2rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10000;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== DAYS SELECTOR FOR TRACKER NOTIFICATIONS ===== */
.days-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.day-checkbox {
    display: block;
    cursor: pointer;
}

.day-checkbox input {
    display: none;
}

.day-checkbox span {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: white;
    border: 2px solid var(--gray-200);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    transition: all 0.2s ease;
}

.day-checkbox input:checked + span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.day-checkbox:hover span {
    border-color: var(--primary);
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .day-checkbox span {
        width: 38px;
        height: 38px;
        font-size: 12px;
    }
    .days-selector {
        gap: 6px;
    }
}
