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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 40px 20px;
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.filters {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
}

.filter-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.filter-group select {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-group select:hover {
    border-color: #3498db;
}

.filter-group select:focus {
    outline: none;
    border-color: #2980b9;
}

.checkbox-group {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 1px;
    flex: 0.5;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.95rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.green {
    background-color: #27ae60;
}

.legend-dot.yellow {
    background-color: #f39c12;
}

.legend-dot.purple {
    background-color: #9b59b6;
}

.legend-dot.red {
    background-color: #e74c3c;
}

#deadlines-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.deadline-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.deadline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 80px;
}

.card-header.header-open {
    background: #27ae60;
}

.card-header.header-warning {
    background: #f39c12;
}

.card-header.header-expired {
    background: #e74c3c;
}

.card-header.header-awaiting {
    background: #9b59b6;
}

.card-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.residency-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.card-body {
    padding: 25px;
}

.deadline-item {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deadline-item:last-child {
    margin-bottom: 0;
}

.label {
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 700;
}

.apply-button {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.apply-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.status-message {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
}

.status-message.awaiting {
    background: #f0e6f6;
    color: #7d3c98;
    border: 2px solid #9b59b6;
}

.no-results {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    #deadlines-container {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .legend {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .legend-item {
        font-size: 0.9rem;
    }
}
