﻿:root {
    --primary-color: #005aa3; /* Swedish Blueish */
    --secondary-color: #fecb00; /* Swedish Yellowish */
    --text-color: #333;
    --background-color: #f4f7fa;
    --card-background: #ffffff;
    --border-radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --spacing-unit: 1rem;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

header {
    background-color: var(--card-background);
    padding: var(--spacing-unit) 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Header actions with lock indicator */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lock-indicator {
    font-size: 1.5rem;
    cursor: help;
    transition: transform 0.2s;
}

.lock-indicator:hover {
    transform: scale(1.2);
}

.lock-indicator.unlocked {
    filter: drop-shadow(0 0 4px rgba(56, 161, 105, 0.5));
}

.lock-indicator.locked {
    filter: drop-shadow(0 0 4px rgba(197, 48, 48, 0.5));
}

.lock-indicator.has-key {
    filter: drop-shadow(0 0 4px rgba(0, 90, 163, 0.5));
}

.lock-indicator.unknown {
    opacity: 0.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
}

input, select {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 90, 163, 0.1);
}

/* Search input specific styling */
.search-input {
    background: white;
    position: relative;
}

.search-input::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 90, 163, 0.15);
}

/* Native search input clear button styling (WebKit browsers) */
.search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    height: 1.25rem;
    width: 1.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a0aec0'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
    background-size: 1.25rem 1.25rem;
    cursor: pointer;
}

.search-input::-webkit-search-cancel-button:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23005aa3'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #004480;
    transform: translateY(-1px);
}

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* When table view replaces event-grid, this ensures table takes full width */
#event-list.event-table-container {
    display: block;
}

#event-list:has(.event-table-container) {
    display: block;
}

/* Month view takes full width */
#event-list:has(.month-calendar-wrapper) {
    display: block;
}

.event-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    user-select: none;
    transform-style: preserve-3d;
}

/* Added state - keep the visual styling */
.event-card.added {
    background: linear-gradient(135deg, #e6f3ff 0%, #f0f7ff 100%);
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 90, 163, 0.15);
}

.event-card.added .event-title {
    color: var(--primary-color);
}

.event-card.flipping {
    transform: rotateY(180deg);
}

/* Ensure smooth flip */
.event-card .event-content,
.event-card .status-indicator {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Back face of card (when flipping) */
.event-card::before {
    content: attr(data-flip-message);
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #004480 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transform: rotateY(180deg);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}

.event-card.flipping::before {
    opacity: 1;
}

/* Scale effect on hover for better interaction feedback */
.event-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 90, 163, 0.2);
}

.event-card.added:hover {
    box-shadow: 0 8px 16px rgba(0, 90, 163, 0.3);
}

.event-card.flipping:hover {
    transform: rotateY(180deg) scale(1.02);
}

/* Status indicator - always visible for added events */
.status-indicator {
    position: absolute;
    top: -10px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 90, 163, 0.3);
    z-index: 10;
    animation: statusSlideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

@keyframes statusSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.status-indicator-add {
    background: #e2e8f0;
    color: #4a5568;
}

.event-card:hover .status-indicator-add {
    background: var(--primary-color);
    color: white;
}

.event-content {
    flex-grow: 1;
    padding-top: 0.5rem;
}

.event-date {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.event-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.event-details {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.event-location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.calendar-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.calendar-info {
    background: #e6ffFA;
    border: 1px solid #38b2ac;
    color: #234e52;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.calendar-info h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.calendar-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.calendar-info li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: #234e52;
}

.calendar-info li:before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.calendar-info li:last-child {
    margin-bottom: 0;
}

.no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    color: #718096;
    font-size: 1.1rem;
}

.event-deadline {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.deadline-normal {
    background: #e6ffed;
    color: #22543d;
    border-left: 3px solid #38a169;
}

.deadline-soon {
    background: #fef5e7;
    color: #744210;
    border-left: 3px solid #ed8936;
}

.deadline-urgent {
    background: #fff5f5;
    color: #742a2a;
    border-left: 3px solid #f56565;
    animation: pulse-deadline 2s ease-in-out infinite;
}

@keyframes pulse-deadline {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.hidden {
    display: none;
}

/* Toggle Switch */
.toggle-checkbox {
    display: none;
}

.toggle-label {
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-label::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-checkbox:checked + .toggle-label {
    background: var(--primary-color);
}

.toggle-checkbox:checked + .toggle-label::after {
    transform: translateX(24px);
}

/* District Pills */
.district-group {
    min-width: 300px;
}

.district-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.district-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.5rem;
   // border: 1px solid #e2e8f0;
   // border-radius: 6px;
   // background: #f7fafc;
    align-items: center;
}

.district-placeholder {
    color: #a0aec0;
    font-size: 0.875rem;
    font-style: italic;
}

.district-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #004480 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 90, 163, 0.2);
    transition: all 0.2s;
    animation: pillSlideIn 0.2s ease-out;
}

.district-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 90, 163, 0.3);
}

.pill-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    transition: all 0.2s;
    font-weight: bold;
}

.pill-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.pill-remove:active {
    transform: scale(0.95);
}

@keyframes pillSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .district-group {
        min-width: 100%;
    }
    
    .district-pills {
        min-height: 3rem;
    }
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0;
    background: #e2e8f0;
    padding: 0.25rem;
    border-radius: 8px;
    align-items: center;
    width: fit-content;
}

.view-toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.view-toggle-btn:hover {
    background: rgba(0, 90, 163, 0.1);
    color: var(--primary-color);
}

.view-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 90, 163, 0.3);
}

/* Table View Styles */
.event-table-container {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.event-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004480 100%);
    color: white;
}

.event-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Compact column widths */
.event-table .col-status {
    width: 40px;
    text-align: center;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.event-table .col-date {
    width: 110px;
    white-space: nowrap;
}

.event-table .col-district {
    width: 120px;
}

.event-table .col-type {
    width: 150px;
}

.event-table .col-deadline {
    width: 120px;
    white-space: nowrap;
}

.event-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.event-table tbody tr:hover {
    background: #f7fafc;
    transform: translateX(4px);
    box-shadow: -4px 0 0 0 var(--primary-color);
}

.event-table tbody tr.added {
    background: linear-gradient(135deg, #e6f3ff 0%, #f0f7ff 100%);
    border-left: 4px solid var(--primary-color);
}

.event-table tbody tr.added .col-status {
    color: var(--primary-color);
    font-weight: bold;
}

.event-table tbody tr.added:hover {
    background: linear-gradient(135deg, #d9edff 0%, #e6f3ff 100%);
}

/* Locked state - dark red background */
.event-card.locked {
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    border: 2px solid #c53030;
    box-shadow: 0 4px 12px rgba(197, 48, 48, 0.15);
}

.event-card.locked .event-title {
    color: #c53030;
}

.event-card.locked::before {
    content: attr(data-flip-message);
    background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
}

.event-card.locked:hover {
    box-shadow: 0 8px 16px rgba(197, 48, 48, 0.25);
}

.status-indicator.locked {
    background: #c53030;
    color: white;
    box-shadow: 0 4px 8px rgba(197, 48, 48, 0.3);
}

/* Table row locked state */
.event-table tbody tr.locked {
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    border-left: 4px solid #c53030;
}

.event-table tbody tr.locked .col-status {
    color: #c53030;
    font-weight: bold;
}

.event-table tbody tr.locked:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.event-table tbody tr.locked .event-table-name {
    color: #c53030;
}

/* Table row locked flash animation */
.event-table tbody tr.locked-flash {
    animation: lockedFlash 1s ease-out;
}

@keyframes lockedFlash {
    0% {
        background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
    }
    40% {
        background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
    }
    100% {
        background: transparent;
    }
}

.event-table tbody tr.locked-flash td {
    animation: lockedFlashText 1s ease-out;
}

@keyframes lockedFlashText {
    0%, 40% {
        color: white;
    }
    100% {
        color: inherit;
    }
}

/* Show lock icon briefly during flash */
.event-table tbody tr.locked-flash .col-status::before {
    content: '🔒';
    animation: lockIconFade 1s ease-out forwards;
}

@keyframes lockIconFade {
    0%, 40% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Locked flip animation - dark red background for cards */
.event-card[data-locked="true"]::before {
    background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%) !important;
}

/* Smooth toggle animation for table rows */
.event-table tbody tr.flipping {
    animation: smoothToggle 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

@keyframes smoothToggle {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    30% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    60% { 
        transform: scale(1.03);
        box-shadow: 0 8px 24px rgba(0, 90, 163, 0.3);
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Success pulse for added state */
@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 90, 163, 0.5);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 90, 163, 0);
    }
}

.event-table tbody tr.flipping.added {
    animation: smoothToggle 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Smooth status icon transition */
.event-table .col-status {
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.event-table tbody tr.flipping .col-status {
    animation: iconBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(0.7) rotate(-15deg);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.5) rotate(15deg);
        opacity: 1;
    }
    75% {
        transform: scale(0.9) rotate(-5deg);
    }
}

.event-table td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    vertical-align: top;
}

.event-table-name {
    font-weight: 600;
    color: var(--text-color);
}

.event-table tbody tr.added .event-table-name {
    color: var(--primary-color);
}

.event-table-date {
    color: #718096;
    white-space: nowrap;
}

/* Date formatting - end date below start date */
.date-end {
    font-size: 0.85rem;
    color: #a0aec0;
    margin-top: 0.25rem;
}

/* Deadline formatting */
.deadline-date {
    color: var(--text-color);
    font-weight: 500;
}

.deadline-warning {
    font-size: 0.75rem;
    color: #ed8936;
    margin-top: 0.25rem;
    font-weight: 600;
}

.event-table-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.event-table-badge-added {
    background: var(--primary-color);
    color: white;
}

.event-table-badge-deadline {
    background: #fef5e7;
    color: #744210;
    border: 1px solid #ed8936;
}

.event-table-badge-deadline-urgent {
    background: #fff5f5;
    color: #742a2a;
    border: 1px solid #f56565;
    animation: pulse 2s ease-in-out infinite;
}

.event-table-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hidden-view {
    display: none !important;
}

/* Month Calendar View */
.month-calendar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.month-calendar-container {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    width: 100%;
}

.month-calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.month-calendar-header h2 {
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 700;
    text-transform: capitalize;
}

.month-calendar {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.month-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow: hidden;
}

.month-calendar-weekday {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004480 100%);
    color: white;
    text-align: center;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month-calendar-weeks {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.month-calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
}

.month-calendar-week:last-child {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    overflow: hidden;
}

.month-calendar-day {
    background: white;
    min-height: 120px;
    padding: 0.75rem;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
    cursor: pointer;
}

.month-calendar-day.other-month {
    background: #f7fafc;
    opacity: 0.4;
}

.month-calendar-day.today {
    background: #fff9e6;
    border: 2px solid var(--secondary-color);
    box-shadow: inset 0 0 0 2px var(--secondary-color);
}

/* Competition days - days with subscribed events - BRIGHT HIGHLIGHT */
.month-calendar-day.competition-day {
    background: linear-gradient(135deg, #e6f3ff 0%, #cce5ff 100%);
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 90, 163, 0.25);
}

.month-calendar-day.competition-day .day-number {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
}

/* Days with only unsubscribed events - subtle */
.month-calendar-day.has-events {
    background: #fafbfc;
    border: 1px solid #e2e8f0;
}

.month-calendar-day.has-events:hover,
.month-calendar-day.competition-day:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 90, 163, 0.3);
    z-index: 5;
}

.month-calendar-day.competition-day:hover {
    background: linear-gradient(135deg, #d9edff 0%, #b3d9ff 100%);
    box-shadow: 0 6px 16px rgba(0, 90, 163, 0.4);
}

.month-calendar-day.active {
    background: linear-gradient(135deg, #b3d9ff 0%, #99ccff 100%);
    box-shadow: 0 4px 12px rgba(0, 90, 163, 0.4);
    z-index: 5;
}

.day-number {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.month-calendar-day.other-month .day-number {
    color: #a0aec0;
}

.month-calendar-day.today .day-number {
    color: #c2850c;
    font-weight: 700;
    font-size: 1.2rem;
}

/* Day indicators container */
.day-indicators {
    display: flex;
    gap: 0.25rem;
    margin-top: auto;
    flex-wrap: wrap;
}

.day-indicator {
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.day-indicator.subscribed {
    background: var(--primary-color);
    color: white;
}

.day-indicator.unsubscribed {
    background: #e2e8f0;
    color: #4a5568;
}

/* Week Detail Row */
.week-detail-row {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f3ff 100%);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    margin: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 90, 163, 0.2);
    overflow: hidden;
}

.week-detail-row.hidden {
    display: none;
}

.detail-date-header {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    text-transform: capitalize;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section-header {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-section.unsubscribed-section .detail-section-header {
    color: #718096;
}

.detail-events {
    display: grid;
    gap: 0.75rem;
}

.detail-event {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.detail-event:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.detail-section.subscribed-section .detail-event {
    border-left: 4px solid var(--primary-color);
}

.detail-section.unsubscribed-section .detail-event {
    border-left: 4px solid #cbd5e0;
}

.detail-event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.detail-event-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
    flex: 1;
}

.detail-section.subscribed-section .detail-event-name {
    color: var(--primary-color);
}

.detail-event-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.detail-event-btn.add {
    background: var(--primary-color);
    color: white;
}

.detail-event-btn.add:hover:not(:disabled) {
    background: #004480;
    transform: translateY(-1px);
}

.detail-event-btn.remove {
    background: #f56565;
    color: white;
}

.detail-event-btn.remove:hover:not(:disabled) {
    background: #c53030;
    transform: translateY(-1px);
}

.detail-event-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.detail-event-info {
    display: flex;
    gap: 1rem;
    color: #718096;
    font-size: 0.875rem;
}

.detail-event-place,
.detail-event-district {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive month calendar */
@media (max-width: 1200px) {
    .month-calendar-day {
        min-height: 100px;
        padding: 0.5rem;
    }
    
    .month-calendar-weekday {
        padding: 0.75rem 0.5rem;
    }
    
    .month-calendar-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .month-calendar-day {
        min-height: 80px;
        padding: 0.25rem;
    }
    
    .month-calendar-weekday {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .month-calendar-header h2 {
        font-size: 1.25rem;
    }
    
    .day-number {
        font-size: 0.875rem;
    }
    
    .month-calendar-day.competition-day .day-number,
    .month-calendar-day.today .day-number {
        font-size: 1rem;
    }
    
    .day-indicator {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        min-width: 20px;
    }
    
    .week-detail-row {
        padding: 1rem;
    }
    
    .detail-event-info {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Month Divider */
.month-divider {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004480 100%);
    cursor: default !important;
}

.month-divider:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004480 100%) !important;
    transform: none !important;
}

.month-divider td {
    padding: 0.5rem 1rem;
    border-top: none;
    border-bottom: 1px solid #cbd5e0;
}

.month-divider-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.month-divider-content::before,
.month-divider-content::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.month-divider-text {
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 1px;
}
