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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.api-setup {
    padding: 40px;
}

.api-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

.api-card h3 {
    color: #1e293b;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.api-card p {
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.6;
}

.api-card ol {
    text-align: left;
    max-width: 500px;
    margin: 0 auto 25px;
    color: #475569;
    line-height: 1.6;
}

.api-card li {
    margin-bottom: 8px;
}

.api-card a {
    color: #4f46e5;
    text-decoration: none;
}

.api-card a:hover {
    text-decoration: underline;
}

.api-input-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.api-input-group input {
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    min-width: 300px;
    transition: border-color 0.2s;
}

.api-input-group input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.api-input-group button {
    padding: 12px 24px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.api-input-group button:hover {
    background: #4338ca;
}

.main-content {
    padding: 30px;
}

.controls {
    background: #f8fafc;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 120px;
}

.filter-group input[type="checkbox"] {
    margin-right: 8px;
}

.refresh-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: auto;
}

.refresh-btn:hover {
    background: #059669;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.events-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

thead {
    background: #f8fafc;
}

thead th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr:nth-child(even) {
    background: #fafafa;
}

tbody tr:nth-child(even):hover {
    background: #f3f4f6;
}

tbody td {
    padding: 16px 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.event-date {
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
}

.event-time {
    color: #6b7280;
    font-size: 0.9rem;
    white-space: nowrap;
}

.event-title {
    font-weight: 500;
    color: #1f2937;
    max-width: 250px;
}

.event-description {
    color: #6b7280;
    font-size: 0.9rem;
    max-width: 300px;
    word-wrap: break-word;
}

.event-location {
    color: #6b7280;
    font-size: 0.9rem;
    max-width: 200px;
    word-wrap: break-word;
}

.all-day-event {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.multi-day-indicator {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 5px;
}

#noEvents {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .refresh-btn {
        margin-left: 0;
    }
    
    .api-input-group {
        flex-direction: column;
    }
    
    .api-input-group input {
        min-width: auto;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    thead th,
    tbody td {
        padding: 12px 8px;
    }
}
