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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    line-height: 1.6;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #38bdf8;
}

.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #38bdf8;
}

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

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

.calendar-controls {
    display: flex;
    gap: 1rem;
}

select, input, textarea, button {
    padding: 0.5rem 1rem;
    border: 1px solid #334155;
    border-radius: 0.375rem;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.875rem;
}

button {
    background: #3b82f6;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #2563eb;
}

.event-list {
    display: grid;
    gap: 1rem;
}

.event-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-card:hover {
    border-color: #38bdf8;
}

.event-date {
    font-weight: bold;
    color: #38bdf8;
    min-width: 100px;
}

.event-title {
    flex: 1;
    margin: 0 1rem;
}

.event-category {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.category-games { background: #1e3a8a; }
.category-movies { background: #7f1d1d; }
.category-music { background: #064e3b; }
.category-comics { background: #4c1d95; }
.category-vinyl { background: #78350f; }

.add-event-form {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
}

.add-event-form form {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.footer {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    border-top: 1px solid #334155;
    margin-top: 2rem;
}

/* Calendar Grid Styles */
.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.calendar-header h2 {
    font-size: 1.5rem;
    color: #38bdf8;
    min-width: 200px;
    text-align: center;
}

.nav-btn {
    background: #1e293b;
    border: 1px solid #334155;
    padding: 0.5rem 1rem;
    font-size: 1.2rem;
}

.today-btn {
    background: #3b82f6;
    margin-left: 1rem;
}

.calendar-grid {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 1rem;
}

.day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: bold;
    color: #64748b;
    font-size: 0.875rem;
}

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

.calendar-cell {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.375rem;
    min-height: 100px;
    padding: 0.5rem;
    position: relative;
}

.calendar-cell.empty {
    background: transparent;
    border: none;
}

.calendar-cell.today {
    border-color: #38bdf8;
    background: #1e3a8a20;
}

.day-number {
    font-weight: bold;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.calendar-cell.today .day-number {
    color: #38bdf8;
}

.event-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.event-icon {
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.event-icon:hover {
    transform: scale(1.3);
}

/* Event Icon Links */
.event-icon-link {
    font-size: 1.25rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    display: inline-block;
}

.event-icon-link:hover {
    transform: scale(1.3);
}

/* Custom Tooltip */
.event-icon-link[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #334155;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
    margin-bottom: 0.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.event-icon-link[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filters select, .filters input {
    flex: 1;
    max-width: 300px;
}

/* Stats Panel */
.stats-panel {
    margin-top: 2rem;
}

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

.stat-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #38bdf8;
}

.stat-label {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
    font-size: 1.125rem;
}

/* Events Page */
.events-app {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.events-app h2 {
    color: #38bdf8;
    margin-bottom: 0.5rem;
}

.events-count {
    color: #64748b;
    font-size: 0.875rem;
}

.sort-controls {
    display: flex;
    align-items: center;
}

.sort-controls select {
    max-width: 150px;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-card-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.event-card-link:hover {
    transform: translateX(4px);
}

.event-card-inner {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 1rem;
    border-left: 4px solid;
    transition: border-color 0.2s;
}

.event-card-link:hover .event-card-inner {
    border-color: #38bdf8;
}

.event-card-inner.category-games { border-left-color: #3b82f6; }
.event-card-inner.category-movies { border-left-color: #ef4444; }
.event-card-inner.category-music { border-left-color: #10b981; }
.event-card-inner.category-vinyl { border-left-color: #f59e0b; }
.event-card-inner.category-comics { border-left-color: #8b5cf6; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.page-btn {
    background: #334155;
    border: 1px solid #475569;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: #475569;
}

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

#page-info {
    color: #94a3b8;
    font-size: 0.875rem;
    min-width: 100px;
    text-align: center;
}

/* Event Detail Page */
.event-detail {
    max-width: 800px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    color: #38bdf8;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: #0ea5e9;
}

.event-card-detail {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 2rem;
}

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

.event-category {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.event-source {
    color: #64748b;
    font-size: 0.875rem;
}

.event-card-detail h1 {
    font-size: 1.75rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.event-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    color: #38bdf8;
    margin-bottom: 1.5rem;
}

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

.event-description {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.event-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-cells {
        gap: 0.25rem;
    }
    
    .calendar-cell {
        min-height: 80px;
        padding: 0.25rem;
    }
    
    .day-number {
        font-size: 0.75rem;
    }
    
    .event-icon {
        font-size: 1rem;
    }
}
