/* ===== BEAUTIFUL BACKGROUND ===== */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Main container - add glass effect */
.container {
    position: relative;
    z-index: 1;
}

/* Floating particles effect (optional - decorative) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== GLASSMORPHISM EFFECT FOR MAIN CARD ===== */
.main-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* DAG Configuration Card - Enhanced */
.dag-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.dag-card:hover {
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

/* Page Title - Enhanced */
.display-5 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Additional styles for multi-task */
.required {
    color: #dc3545;
    font-weight: bold;
}

/* Task Cards - Enhanced */
.task-card .card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.task-card .card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.25);
    transform: translateY(-3px);
}

/* Subtle animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-card {
    animation: fadeIn 0.5s ease-out;
}

/* Card Headers - Gradient */
.card-header.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none;
    border-radius: 13px 13px 0 0 !important;
}

/* ===== SCHEDULE BUILDER ===== */

.schedule-options {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.schedule-options .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.schedule-options .form-select-sm {
    font-size: 0.9rem;
}

/* Day of week buttons */
.btn-group .btn-check:checked + .btn-outline-primary {
    background-color: #667eea;
    border-color: #667eea;
}

.btn-group label.btn {
    font-size: 0.85rem;
    padding: 0.375rem 0.5rem;
}

/* Schedule preview alert */
#schedule_preview {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 1px solid #667eea;
    border-radius: 8px;
}

#schedule_preview code {
    background: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: #e83e8c;
    font-weight: 600;
}

/* Smooth transitions */
.schedule-options {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

/* ===== HORIZONTAL FORM LAYOUT ===== */

/* Form field container - horizontal layout */
.form-field-horizontal {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 2rem;
}

/* Label column - fixed width, right-aligned */
.form-label-horizontal {
    flex: 0 0 220px;
    min-width: 220px;
    padding-top: 0.625rem;
    text-align: right;
    font-size: 0.95rem;
    color: #2c3e50;
    line-height: 1.5;
}

/* Make fw-bold work inside labels */
.form-label-horizontal .fw-bold {
    font-weight: 700;
    font-size: 1rem;
}

/* Optional badge */
.badge.bg-secondary {
    font-weight: 500;
    padding: 0.25em 0.6em;
}

/* Optional field - minimal styling */
.optional-field {
    /* No special styling - looks like regular fields */
}

/* Optional toggle button */
button[id*="optional-toggle"] {
    transition: all 0.3s ease;
}

button[id*="optional-toggle"]:hover {
    transform: translateY(-2px);
}

/* Input column - takes remaining space */
.form-input-horizontal {
    flex: 1;
    min-width: 0;
}

/* Adjust form controls for horizontal layout */
.form-input-horizontal .form-control,
.form-input-horizontal .form-select,
.form-input-horizontal textarea {
    width: 100%;
}

/* Required star in horizontal layout */
.form-label-horizontal .required {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* Info icon alignment in horizontal layout */
.form-label-horizontal i[data-bs-toggle="tooltip"] {
    cursor: help;
    color: #667eea;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.form-label-horizontal i[data-bs-toggle="tooltip"]:hover {
    opacity: 1;
    transform: scale(1.1);
    color: #5568d3;
}

/* Form text (descriptions) - below input in horizontal layout */
.form-input-horizontal .form-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.375rem;
    line-height: 1.4;
}

.form-input-horizontal .form-text i {
    color: #667eea;
}

/* Checkbox alignment in horizontal layout */
.form-input-horizontal .form-check {
    padding-top: 0.5rem;
}

.form-check-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #495057;
    margin-left: 0.5rem;
}

/* Alert inside horizontal layout */
.form-input-horizontal .alert {
    margin-bottom: 0.5rem;
}

/* Column dtypes container in horizontal layout */
.form-input-horizontal #column-dtypes-container {
    width: 100%;
}

/* Responsive: Stack vertically on smaller screens */
@media (max-width: 768px) {
    .form-field-horizontal {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-label-horizontal {
        flex: 1;
        text-align: left;
        padding-top: 0;
        min-width: auto;
    }

    .form-input-horizontal {
        width: 100%;
    }
}

/* ===== END HORIZONTAL LAYOUT ===== */

.form-label {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

/* Input Fields - Enhanced Focus */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    background: rgba(255, 255, 255, 0.95);
}

.yaml-preview {
    background: #f8f9fa !important;
    color: #212529 !important;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow-x: auto;
    max-height: 500px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
    padding: 1.5rem;
}

/* YAML Modal - Enhanced */
.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%) !important;
    color: white !important;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Modal dark background */
.modal-body.bg-dark {
    background: #1a202c !important;
}

/* Ensure pre tag doesn't override */
#yaml-content {
    color: #e2e8f0 !important;
    background: #2d3748 !important;
    margin: 0;
    padding: 1.5rem;
}

/* Collapsible sections - Enhanced Gradients */
.collapsible-header {
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.collapsible-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.collapsible-header.destination {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 2px 10px rgba(56, 239, 125, 0.3);
}

.collapsible-header.destination:hover {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.collapsible-header i.fa-chevron-down {
    transition: transform 0.3s ease;
}

.collapsible-header.collapsed i.fa-chevron-down {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Form Sections - Subtle Background */
.form-sections {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.6) 0%, rgba(255, 255, 255, 0.8) 100%);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* Badge for field count */
.field-count-badge {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Form field labels - bold and larger */
.field-label {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: block;
    letter-spacing: 0.3px;
}

/* Required star */
.required {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* Form inputs - slightly larger text */
.form-control, .form-select {
    font-size: 0.95rem;
    padding: 0.625rem 0.875rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* Form text (descriptions) */
.form-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.375rem;
    line-height: 1.4;
}

.form-text i {
    color: #667eea;
}

.form-text code {
    background: #f8f9fa;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: #e83e8c;
    font-size: 0.85em;
}

/* Checkbox labels */
.form-check-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #495057;
    margin-left: 0.5rem;
}

/* Textarea */
textarea.form-control {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Monospace inputs (for variables, JSON) */
textarea.font-monospace {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

textarea[data-widget="variables"] {
    background: #f8f9fa;
    border: 2px dashed #6c757d;
}

textarea[data-widget="variables"]:focus {
    background: #fff;
    border-color: #667eea;
    border-style: solid;
}

/* Placeholder text */
::placeholder {
    color: #adb5bd;
    opacity: 1;
    font-style: italic;
}

/* Better spacing for form fields */
.form-field-group {
    margin-bottom: 1.25rem;
}

/* Collapsible form sections */
.form-sections .row {
    margin-top: 0;
}

.form-sections .col-md-6 {
    margin-bottom: 1rem;
}

/* Eye icon styling */
i[data-bs-toggle="tooltip"] {
    cursor: help;
    color: #667eea;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: all 0.2s ease;
}

i[data-bs-toggle="tooltip"]:hover {
    opacity: 1;
    transform: scale(1.1);
    color: #5568d3;
}

/* Bootstrap tooltip customization - Enhanced */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    max-width: 300px;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tooltip-arrow::before {
    border-top-color: #2c3e50 !important;
}

/* Example text styling */
small.text-muted {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

/* Buttons - Enhanced */
.btn-generate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.btn-generate:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    transform: translateY(-2px);
    color: white;
}

.btn-preview {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    transition: all 0.3s ease;
}

.btn-preview:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
    transform: translateY(-2px);
    color: white;
}

/* Add Task Button - Enhanced */
#add-task-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px dashed #667eea;
    color: #667eea;
    transition: all 0.3s ease;
}

#add-task-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Success/Info Alerts - Enhanced */
.alert {
    border-radius: 10px;
    border: none;
    backdrop-filter: blur(10px);
}

.alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.15) 0%, rgba(13, 202, 240, 0.1) 100%);
    border-left: 4px solid #0dcaf0;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.1) 100%);
    border-left: 4px solid #ffc107;
}

.alert-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.15) 0%, rgba(25, 135, 84, 0.1) 100%);
    border-left: 4px solid #198754;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.15) 0%, rgba(220, 53, 69, 0.1) 100%);
    border-left: 4px solid #dc3545;
}

/* Loading spinner - Enhanced */
.fa-spinner {
    filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5));
}