/* ===============================================
   Event Detail Modal Styles
   =============================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.event-detail-modal {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.event-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, #004480 100%);
    color: white;
}

.event-detail-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
}

.close-detail {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close-detail:hover {
    opacity: 1;
}

.event-detail-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

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

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

.event-detail-section h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.event-detail-section p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.competition-block {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 6px;
}

.competition-block h4 {
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.class-deadlines {
    margin-bottom: 0.75rem;
}

.class-deadlines strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.class-deadlines ul {
    list-style: none;
    padding-left: 0;
}

.class-deadlines li {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.class-deadlines li.deadline-past {
    background: #f1f5f9;
    color: #64748b;
}

.class-deadlines li.deadline-urgent {
    background: #fee2e2;
    color: #991b1b;
    font-weight: 600;
}

.class-deadlines li.deadline-soon {
    background: #fef3c7;
    color: #92400e;
}

.class-deadlines li.deadline-normal {
    background: #e0f2fe;
    color: #075985;
}

.deadline-name {
    flex: 1;
}

.deadline-date {
    font-weight: 600;
    white-space: nowrap;
    margin-left: 1rem;
}

.external-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.external-link:hover {
    text-decoration: underline;
}

.event-detail-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    background: #f7fafc;
}

.event-detail-footer .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.event-detail-footer .btn-add:hover {
    background: #004480;
}

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

.event-detail-footer .btn-remove:hover {
    background: #dc2626;
}

.event-detail-footer .btn-secondary {
    background: #718096;
    color: white;
}

.event-detail-footer .btn-secondary:hover {
    background: #4a5568;
}

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

.loading {
    padding: 3rem;
    text-align: center;
    color: #718096;
}

.error {
    padding: 3rem;
    text-align: center;
    color: #ef4444;
}

/* ===============================================
   Event Card Action Buttons
   =============================================== */

.event-card-actions {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

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

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

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

.btn-remove-card {
    background: #ef4444;
    color: white;
}

.btn-remove-card:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

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

/* ===============================================
   Table Action Buttons
   =============================================== */

.col-action {
    text-align: center;
    width: 120px;
}

.table-action-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.813rem;
}

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

.btn-add-table:hover:not(:disabled) {
    background: #004480;
}

.btn-remove-table {
    background: #ef4444;
    color: white;
}

.btn-remove-table:hover:not(:disabled) {
    background: #dc2626;
}

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

/* ===============================================
   Responsive Design for Modal
   =============================================== */

@media (max-width: 768px) {
    .modal-content {
        max-height: 95vh;
        margin: 0.5rem;
    }
    
    .event-detail-header {
        padding: 1rem;
    }
    
    .event-detail-header h2 {
        font-size: 1.25rem;
    }
    
    .event-detail-body {
        padding: 1rem;
    }
    
    .event-detail-footer {
        flex-direction: column;
    }
    
    .event-detail-footer .btn {
        width: 100%;
    }
    
    .class-deadlines li {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .deadline-date {
        margin-left: 0;
        margin-top: 0.25rem;
    }
}
