/* Theme-specific CSS variables added via JavaScript */
/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--modal-bg, white);
    margin: auto;
    padding: 0;
    border-radius: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--modal-border, rgba(0, 0, 0, 0.1));
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: var(--gradient-1);
    color: white;
    padding: 2rem;
    border-radius: 24px 24px 0 0;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.75rem;
    color: white;
}

.modal-header p {
    margin: 0.5rem 0 0;
    opacity: 0.95;
    color: white;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.2);
}

.close:hover,
.close:focus {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group label .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--input-border, rgba(0, 0, 0, 0.1));
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: var(--input-bg, white);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(11, 95, 255, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted, #94a3b8);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.modal-footer {
    padding: 1.5rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-submit {
    padding: 0.875rem 2rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'DM Sans', sans-serif;
    box-shadow: 0 4px 20px rgba(11, 95, 255, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(11, 95, 255, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-cancel {
    padding: 0.875rem 2rem;
    background: var(--cancel-btn-bg, rgba(0, 0, 0, 0.05));
    color: var(--text-primary);
    border: 1px solid var(--cancel-btn-border, rgba(0, 0, 0, 0.1));
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'DM Sans', sans-serif;
}

.btn-cancel:hover {
    background: var(--cancel-btn-hover, rgba(0, 0, 0, 0.1));
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: none;
    animation: slideDown 0.3s ease-out;
}

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

.alert.show {
    display: block;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 9999;
    background: var(--theme-switcher-bg, rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(12px);
    border: 1px solid var(--theme-switcher-border, rgba(0, 0, 0, 0.1));
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: 0 4px 20px var(--theme-switcher-shadow, rgba(0, 0, 0, 0.08));
    display: flex;
    gap: 0.5rem;
    transition: all 0.3s;
}

.theme-switcher:hover {
    box-shadow: 0 6px 30px var(--theme-switcher-shadow, rgba(0, 0, 0, 0.12));
}

.theme-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 20px;
    background: transparent;
}

.theme-btn.active {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 2px 10px rgba(11, 95, 255, 0.3);
}

.theme-btn:not(.active) {
    color: var(--text-muted, #64748B);
}

.theme-btn:not(.active):hover {
    background: var(--theme-btn-hover, rgba(0, 0, 0, 0.05));
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem auto;
    }
    
    .modal-header {
        padding: 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
        padding: 1rem 1.5rem 1.5rem;
    }
    
    .btn-submit,
    .btn-cancel {
        width: 100%;
    }
    
    .theme-switcher {
        right: 1rem;
        top: 90px;
    }
}
