:root {
    --primary: #E1523D; /* Coral */
    --primary-hover: #ED8B16; /* Orange */
    --accent: #C2BB00; /* Mustard Yellow */
    --bg-gradient: linear-gradient(135deg, #003547 0%, #005E54 100%); /* Teal */
    --card-bg: rgba(255, 255, 255, 0.92);
    --card-border: rgba(255, 255, 255, 0.4);
    --text-main: #003547;
    --text-muted: #005E54;
    --shadow: 0 8px 32px rgba(0, 53, 71, 0.2);
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    margin: 0;
    display: flex;
    justify-content: center;
    color: var(--text-main);
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    margin: 10px 10px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--card-border);
}

header {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    padding: 15px 15px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

h1 { 
    margin: 0; 
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filters-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.custom-filter {
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.custom-filter:hover {
    background: rgba(255, 255, 255, 0.3);
}

.custom-filter option {
    color: var(--text-main);
    background: white;
}

.multi-select-container {
    position: relative;
    display: inline-block;
}

.multi-select-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.multi-select-button .arrow {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.8);
}

.multi-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.multi-select-dropdown.show {
    display: flex;
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
    user-select: none;
}

.dropdown-option:hover {
    background: rgba(0,0,0,0.05);
}

.dropdown-option input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--primary);
}

.view-selector {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.view-selector button {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 6px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.view-selector button:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.view-selector button.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#content-display {
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
}

.view-title {
    font-size: 1.15rem;
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 800;
    text-align: center;
}

.event-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 6px solid var(--accent);
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    background: rgba(225, 82, 61, 0.1);
    color: var(--primary);
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tipo-tit { 
    font-size: 1rem;
    font-weight: 800; 
    color: var(--text-main);
    margin: 0 0 4px 0; 
    padding-right: 70px;
}

.time-info { 
    color: var(--text-muted); 
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.desc-info { 
    margin-top: 8px; 
    padding-top: 8px; 
    border-top: 1px dashed rgba(0,0,0,0.1); 
    font-size: 0.8rem;
    color: #4b5563; 
    line-height: 1.4;
}

.fecha-header { 
    color: var(--text-muted); 
    font-size: 0.95rem;
    font-weight: 600;
    margin: 15px 0 10px 0; 
    border-bottom: 2px solid rgba(0,0,0,0.05); 
    padding-bottom: 4px; 
    text-transform: capitalize; 
}

/* CALENDAR STYLES */
.month-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.nav-btn {
    background: rgba(225, 82, 61, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 1.5rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    padding-bottom: 4px;
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 15px;
}

.calendar-header {
    text-align: center;
    font-weight: 800;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding-bottom: 3px;
}

.calendar-day {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(4px);
    border-radius: 8px;
    aspect-ratio: 1; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4px 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.calendar-day:not(.empty):hover {
    transform: scale(1.05);
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: default;
}

.calendar-day.today {
    border: 2px solid var(--primary);
    background: rgba(225, 82, 61, 0.05);
    font-weight: 800;
}

.calendar-day.active {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(225, 82, 61, 0.3);
}

.calendar-day.active .calendar-dot {
    border-color: white; 
    border: 1px solid rgba(255,255,255,0.5);
}

.calendar-day .day-num {
    font-size: 0.8rem;
    margin-bottom: 2px;
    font-weight: 600;
}

.calendar-day.active .day-num {
    color: white;
}

.calendar-events {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    width: 100%;
}

.calendar-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.calendar-dot-more {
    font-size: 0.5rem;
    font-weight: 800;
    color: var(--text-muted);
    line-height: 4px;
}
.calendar-day.active .calendar-dot-more { color: white; }

.calendar-details {
    min-height: 150px;
    background: rgba(255,255,255,0.4);
    border-radius: 12px;
    padding: 10px;
    border: 1px dashed rgba(0,0,0,0.1);
}

footer {
    padding: 15px;
    background: transparent;
}

.btn-form {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669, #047857);
}

.loader { 
    text-align: center; 
    margin-top: 40px; 
    color: var(--primary); 
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(225, 82, 61, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.no-data {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 15px;
    font-style: italic;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.2);
}