:root {
    --liturgical-color: #6b2c91;
    --primary-bg: #f8f9fa;
    --secondary-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e1e8ed;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-bg) 0%, #e9ecef 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 20px;
    background: var(--secondary-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border-top: 4px solid var(--liturgical-color);
}

.header h1 {
    font-size: 2.5em;
    color: #2c3e50;  /* CRNA boja */
    margin-bottom: 10px;
    font-weight: 600;
}

.header .subtitle {
    color: #555;  /* Tamnija siva */
    font-size: 1.1em;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
}

/* Calendar Sidebar */
.calendar-sidebar {
    background: var(--secondary-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.calendar-header h2 {
    font-size: 1.3em;
    color: var(--text-primary);
}

.nav-btn {
    background: var(--liturgical-color);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Calendar Grid */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.day-name {
    text-align: center;
    font-weight: 600;
    font-size: 0.85em;
    color: var(--text-secondary);
    padding: 8px 0;
}

.calendar-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-date {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.calendar-date.empty {
    cursor: default;
}

.calendar-date.available {
    background: var(--primary-bg);
    color: var(--text-primary);
}

.calendar-date.available:hover {
    background: var(--liturgical-color);
    color: white;
    transform: scale(1.05);
}

.calendar-date.today {
    border-color: var(--liturgical-color);
    font-weight: 700;
}

.calendar-date.selected {
    background: var(--liturgical-color) !important;
    color: white !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Legend */
.legend {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

/* Project Info (zamjena za legend) */
.project-info {
    margin-top: 30px;
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: 8px;
    border-left: 3px solid #4A90E2;
}

.project-info h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.1em;
    font-weight: 600;
}

.project-info p {
    font-size: 0.9em;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* Content Panels */
.content-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.panel {
    background: var(--secondary-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
}

.panel-header {
    background: linear-gradient(135deg, #4A90E2, #5BA3F5);  /* Svijetlo plava */
    color: #2c3e50;  /* CRNI tekst */
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.4em;
    font-weight: 600;
    color: #2c3e50;  /* CRNI */
}

.date-badge {
    background: rgba(0, 0, 0, 0.1);  /* Tamnija pozadina za čitljivost */
    color: #2c3e50;  /* CRNI tekst */
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.panel-content {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.panel-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track {
    background: var(--primary-bg);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: var(--liturgical-color);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: #8e44ad;
}

/* Content Styling */
.panel-content h3 {
    color: #2c3e50;  /* CRNA boja - uvijek čitljivo */
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
    border-left: 4px solid #2c3e50;  /* CRNA crtica - uvijek vidljivo */
    padding-left: 15px;
}

.panel-content h3:first-child {
    margin-top: 0;
}

.panel-content h4 {
    color: #2c3e50;  /* CRNA boja */
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 1.1em;
    font-weight: 600;
    font-style: italic;
}

.panel-content h4.sub-title {
    color: #555;  /* Tamnija siva */
    opacity: 1;
}

.panel-content p {
    margin-bottom: 15px;
    text-align: justify;
    line-height: 1.8;
}

.panel-content p.italic {
    font-style: italic;
    color: var(--text-secondary);
    border-left: 3px solid var(--border-color);
    padding-left: 15px;
    margin-left: 10px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

.error {
    text-align: center;
    padding: 60px 20px;
    color: #e74c3c;
}

.error h3 {
    color: #e74c3c;
    margin-bottom: 20px;
}

.error ul, .error ol {
    margin: 15px 0;
    padding-left: 20px;
}

.error li {
    margin: 8px 0;
}

.error code {
    background: rgba(220, 20, 60, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #dc143c;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-panels {
        grid-template-columns: 1fr;
    }
    
    .panel {
        max-height: 600px;
    }
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .calendar-sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 1.6em;
    }
    
    .header .subtitle {
        font-size: 1em;
    }
    
    .calendar-sidebar {
        padding: 15px;
    }
    
    .calendar-header h2 {
        font-size: 1.1em;
    }
    
    .nav-btn {
        width: 35px;
        height: 35px;
        font-size: 1.3em;
    }
    
    .panel-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .panel-header h2 {
        font-size: 1.2em;
    }
    
    .panel-content {
        padding: 20px 15px;
        font-size: 0.95em;
        line-height: 1.7;
    }
    
    .panel-content h3 {
        font-size: 1.1em;
        margin-top: 20px;
    }
    
    .panel-content p {
        margin-bottom: 12px;
    }
    
    .calendar-dates {
        gap: 3px;
    }
    
    .calendar-days {
        gap: 3px;
    }
    
    .day-name {
        font-size: 0.75em;
        padding: 5px 0;
    }
    
    /* Veći touch targets za kalendar */
    .calendar-date {
        min-height: 40px;
        font-size: 0.9em;
    }
    
    /* Bolji prikaz panela na mobitelu */
    .panel {
        max-height: none;
        margin-bottom: 20px;
    }
    
    /* Smooth scroll do sadržaja nakon odabira datuma */
    .content-panels {
        scroll-margin-top: 20px;
    }
}

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

.panel-content > * {
    animation: fadeIn 0.5s ease-out;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 0.9em;
    border-top: 1px solid var(--border-color);
}

.footer a {
    color: #4A90E2;  /* Plava boja (ista kao headeri) */
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
    color: #357ABD;  /* Tamnija plava na hover */
}

/* Posebni stilovi za čitanja */
.section-title {
    color: #2c3e50;  /* CRNA boja - uvijek čitljivo */
    font-size: 1.2em;
    margin-top: 25px;
    margin-bottom: 12px;
    font-weight: 600;
}

.bible-ref {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.word-of-lord {
    font-style: italic;
    color: #2c3e50;  /* CRNA boja - uvijek čitljivo */
    font-weight: 600;
    margin-top: 15px;
}

.liturgical-color {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin: 10px 0;
}

.liturgical-color[data-color="ljubičasta"] {
    background: rgba(107, 44, 145, 0.1);
    color: #6b2c91;
}

.liturgical-color[data-color="bijela"] {
    background: rgba(255, 255, 255, 1);
    color: #2c3e50;
    border: 2px solid #e1e8ed;
}

.liturgical-color[data-color="zelena"] {
    background: rgba(45, 80, 22, 0.1);
    color: #2d5016;
}

.liturgical-color[data-color="crvena"] {
    background: rgba(220, 20, 60, 0.1);
    color: #dc143c;
}

.info {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}
