<?php $__env->startSection('title', $tour->name . ' - Genel Bilgiler'); ?>
<?php $__env->startSection('page_title', 'Günübirlik Tur Düzenle'); ?>

<?php
    $breadcrumbs = [
        ['title' => 'Ana Sayfa', 'url' => route('agency.dashboard')],
        ['title' => 'Günübirlik Turlar', 'url' => route('agency.products.gunubirlik-turlar.index')],
        ['title' => $tour->name, 'url' => ''],
        ['title' => 'Genel Bilgiler', 'url' => '']
    ];
?>

<?php $__env->startPush('styles'); ?>
    <!-- Quill Rich Text Editor CSS -->
    <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
    <style>
        .tour-detail-container {
            max-width: 1200px;
            margin: 0 auto;
        }

        .tour-header {
            background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
            color: white;
            padding: 2rem;
            border-radius: var(--radius-xl);
            margin-bottom: 2rem;
            position: relative;
            overflow: hidden;
        }

        .tour-header::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 200px;
            height: 200px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            transform: translate(50%, -50%);
        }

        .tour-header-content {
            position: relative;
            z-index: 2;
        }

        .tour-title {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }

        .tour-code {
            font-size: 14px;
            opacity: 0.9;
            margin-bottom: 1rem;
        }

        .tour-meta {
            display: flex;
            gap: 2rem;
            flex-wrap: wrap;
        }

        .tour-meta-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 14px;
        }

        .tour-meta-icon {
            font-size: 16px;
            opacity: 0.8;
        }

        .tabs-container {
            background: white;
            border: 1px solid var(--gray-200);
            border-radius: var(--radius-xl);
            overflow: hidden;
            margin-bottom: 2rem;
        }

        .nav-tabs {
            background: var(--gray-50);
            border-bottom: 1px solid var(--gray-200);
            padding: 0 1rem;
            margin: 0;
        }

        .nav-tabs .nav-link {
            border: none;
            border-radius: 0;
            color: var(--gray-600);
            font-weight: 500;
            padding: 1rem 1.5rem;
            position: relative;
            transition: var(--transition);
        }

        .nav-tabs .nav-link:hover {
            color: var(--primary-color);
            background: transparent;
            border-color: transparent;
        }

        .nav-tabs .nav-link.active {
            color: var(--primary-color);
            background: transparent;
            border-color: transparent;
            font-weight: 600;
        }

        .nav-tabs .nav-link.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--primary-color);
            border-radius: 3px 3px 0 0;
        }

        .tab-content {
            padding: 2rem;
        }

        .form-section {
            background: white;
            border: 1px solid var(--gray-200);
            border-radius: var(--radius-lg);
            padding: 2rem;
            margin-bottom: 2rem;
        }

        .section-header {
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 2px solid var(--gray-200);
        }

        .section-title {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--gray-900);
            margin: 0;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .section-icon {
            color: var(--primary-color);
            font-size: 1.5rem;
        }

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

        .form-label {
            font-weight: 600;
            color: var(--gray-900);
            margin-bottom: 0.5rem;
            display: block;
        }

        .form-text {
            font-size: 0.875rem;
            color: var(--gray-600);
            margin-top: 0.25rem;
        }

        .quill-editor-container {
            background: white;
            border: 1px solid var(--gray-300);
            border-radius: var(--radius-lg);
        }

        .ql-toolbar {
            border: none !important;
            border-bottom: 1px solid var(--gray-200) !important;
            background: var(--gray-50);
        }

        .ql-container {
            border: none !important;
            min-height: 200px;
            font-size: 14px;
        }

        .actions-bar {
            position: sticky;
            bottom: 0;
            background: white;
            border-top: 2px solid var(--gray-200);
            padding: 1.5rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: -2rem -2rem 0;
            border-radius: 0 0 var(--radius-xl) var(--radius-xl);
        }

        .weekdays-selection {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
            padding: 1rem;
            background: var(--gray-50);
            border-radius: var(--radius-lg);
            margin-bottom: 0.5rem;
        }

        .weekday-checkbox {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: white;
            border: 2px solid var(--gray-300);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: var(--transition);
        }

        .weekday-checkbox:hover {
            border-color: var(--primary-color);
        }

        .weekday-checkbox input[type="checkbox"]:checked ~ label,
        .weekday-checkbox:has(input[type="checkbox"]:checked) {
            border-color: var(--primary-color);
            background: var(--primary-light);
        }

        .weekday-checkbox input[type="checkbox"] {
            cursor: pointer;
        }

        .weekday-checkbox label {
            cursor: pointer;
            margin-bottom: 0;
            font-weight: 500;
            color: var(--gray-700);
        }
    </style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
    <div class="tour-detail-container">
        <!-- Tour Header -->
        <div class="tour-header">
            <div class="tour-header-content">
                <div class="tour-code">Tur Kodu: <?php echo e($tour->code); ?></div>
                <h1 class="tour-title"><?php echo e($tour->name); ?></h1>
                <div class="tour-meta">
                    <div class="tour-meta-item">
                        <i class="fas fa-map-marker-alt tour-meta-icon"></i>
                        <?php echo e($tour->departureCity->city ?? 'Belirtilmemiş'); ?>

                        → <?php echo e($tour->arrivalCity->city ?? 'Belirtilmemiş'); ?>

                    </div>
                    <div class="tour-meta-item">
                        <i class="fas fa-clock tour-meta-icon"></i>
                        <?php echo e(substr($tour->start_time, 0, 5)); ?> - <?php echo e(substr($tour->end_time, 0, 5)); ?>

                    </div>
                    <div class="tour-meta-item">
                        <i class="fas fa-dollar-sign tour-meta-icon"></i>
                        <?php echo e(number_format($tour->adult_price, 0)); ?> <?php echo e($tour->currency); ?>

                    </div>
                </div>
            </div>
        </div>

        <!-- Tabs Container -->
        <div class="tabs-container">
            <!-- Tab Navigation -->
            <?php echo $__env->make('agency.products.gunubirlik-turlar._nav', ['active' => 'general'], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <!-- Tab Content -->
            <div class="tab-content">
                <form method="POST" action="<?php echo e(route('agency.products.gunubirlik-turlar.update-general', $tour)); ?>" id="generalForm">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('PUT'); ?>

                    <!-- Basic Information Section -->
                    <div class="form-section" id="basic-info">
                        <div class="section-header">
                            <h3 class="section-title">
                                <i class="fas fa-info-circle section-icon"></i>
                                Temel Bilgiler
                            </h3>
                        </div>

                        <div class="row">
                            <div class="col-md-8">
                                <div class="form-group">
                                    <label class="form-label">Tur Adı</label>
                                    <input type="text" name="name" class="form-control"
                                           value="<?php echo e(old('name', $tour->name)); ?>" required>
                                    <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label class="form-label">Tur Tipi</label>
                                    <select name="tour_type" class="form-select" required>
                                        <option value="domestic" <?php echo e(old('tour_type', $tour->tour_type) === 'domestic' ? 'selected' : ''); ?>>
                                            Yurt İçi
                                        </option>
                                        <option value="international" <?php echo e(old('tour_type', $tour->tour_type) === 'international' ? 'selected' : ''); ?>>
                                            Yurt Dışı
                                        </option>
                                    </select>
                                    <?php $__errorArgs = ['tour_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="form-label">Kısa Açıklama</label>
                            <textarea name="short_description" class="form-control" rows="3"
                                      maxlength="500"><?php echo e(old('short_description', $tour->short_description)); ?></textarea>
                            <div class="form-text">Maksimum 500 karakter</div>
                            <?php $__errorArgs = ['short_description'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="form-group">
                            <label class="form-label">Detaylı Açıklama</label>
                            <div class="quill-editor-container">
                                <div id="editor-description"></div>
                            </div>
                            <input type="hidden" name="description" id="description-input"
                                   value="<?php echo e(old('description', $tour->description)); ?>">
                            <?php $__errorArgs = ['description'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                    </div>

                    <!-- Location & Time Section -->
                    <div class="form-section" id="location-time">
                        <div class="section-header">
                            <h3 class="section-title">
                                <i class="fas fa-map-marker-alt section-icon"></i>
                                Konum ve Zaman
                            </h3>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label">Kalkış Şehri</label>
                                    <select name="departure_city_id" class="form-select" required>
                                        <option value="">Seçiniz</option>
                                        <?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($city->id); ?>"
                                                <?php echo e(old('departure_city_id', $tour->departure_city_id) == $city->id ? 'selected' : ''); ?>>
                                                <?php echo e($city->city); ?>

                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                    <?php $__errorArgs = ['departure_city_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label">Varış Şehri</label>
                                    <select name="arrival_city_id" class="form-select" required>
                                        <option value="">Seçiniz</option>
                                        <?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($city->id); ?>"
                                                <?php echo e(old('arrival_city_id', $tour->arrival_city_id) == $city->id ? 'selected' : ''); ?>>
                                                <?php echo e($city->city); ?>

                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                    <?php $__errorArgs = ['arrival_city_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label">Başlangıç Saati</label>
                                    <input type="time" name="start_time" class="form-control"
                                           value="<?php echo e(old('start_time', $tour->start_time ? substr($tour->start_time, 0, 5) : '')); ?>" required>
                                    <?php $__errorArgs = ['start_time'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label">Bitiş Saati</label>
                                    <input type="time" name="end_time" class="form-control"
                                           value="<?php echo e(old('end_time', $tour->end_time ? substr($tour->end_time, 0, 5) : '')); ?>" required>
                                    <?php $__errorArgs = ['end_time'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="form-label">Tekrar Eden Günler</label>
                            <div class="weekdays-selection">
                                <?php
                                    $weekdays = [
                                        'monday' => 'Pazartesi',
                                        'tuesday' => 'Salı',
                                        'wednesday' => 'Çarşamba',
                                        'thursday' => 'Perşembe',
                                        'friday' => 'Cuma',
                                        'saturday' => 'Cumartesi',
                                        'sunday' => 'Pazar',
                                    ];
                                    $selectedDays = old('recurring_days', $tour->recurring_days ?? []);
                                ?>
                                <?php $__currentLoopData = $weekdays; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="weekday-checkbox">
                                        <input type="checkbox" name="recurring_days[]" id="day_<?php echo e($key); ?>"
                                               value="<?php echo e($key); ?>"
                                               <?php echo e(in_array($key, $selectedDays) ? 'checked' : ''); ?>

                                               class="form-check-input">
                                        <label for="day_<?php echo e($key); ?>" class="form-check-label"><?php echo e($name); ?></label>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                            <div class="form-text">Turun tekrar edeceği günleri seçin. Seçili günlerde otomatik tarihler oluşturulacaktır.</div>
                            <?php $__errorArgs = ['recurring_days'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                    </div>

                    <!-- Features Section -->
                    <div class="form-section" id="features">
                        <div class="section-header">
                            <h3 class="section-title">
                                <i class="fas fa-star section-icon"></i>
                                Özellikler
                            </h3>
                        </div>

                        <div class="form-group">
                            <label class="form-label">Gezilecek Yerler</label>
                            <div class="quill-editor-container">
                                <div id="editor-places-to-visit"></div>
                            </div>
                            <input type="hidden" name="places_to_visit" id="places-to-visit-input"
                                   value="<?php echo e(old('places_to_visit', $tour->places_to_visit)); ?>">
                            <div class="form-text">Tur kapsamında gezilecek yerleri listeleyin</div>
                            <?php $__errorArgs = ['places_to_visit'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label">Dahil Edilen Hizmetler</label>
                                    <?php if(isset($inclusionsTemplates) && $inclusionsTemplates->count() > 0): ?>
                                        <select class="form-select mb-2" id="inclusionsTemplateSelect">
                                            <option value="">Şablon Seç (Opsiyonel)</option>
                                            <?php $__currentLoopData = $inclusionsTemplates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $template): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($template->id); ?>" data-content="<?php echo e($template->description); ?>">
                                                    <?php echo e($template->name); ?>

                                                </option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    <?php endif; ?>
                                    <div class="quill-editor-container">
                                        <div id="editor-inclusions"></div>
                                    </div>
                                    <input type="hidden" name="inclusions" id="inclusions-input"
                                           value="<?php echo e(old('inclusions', $tour->inclusions)); ?>">
                                    <div class="form-text">Tur fiyatına dahil olan hizmetleri listeleyin</div>
                                    <?php $__errorArgs = ['inclusions'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label">Dahil Edilmeyen Hizmetler</label>
                                    <?php if(isset($exclusionsTemplates) && $exclusionsTemplates->count() > 0): ?>
                                        <select class="form-select mb-2" id="exclusionsTemplateSelect">
                                            <option value="">Şablon Seç (Opsiyonel)</option>
                                            <?php $__currentLoopData = $exclusionsTemplates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $template): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($template->id); ?>" data-content="<?php echo e($template->description); ?>">
                                                    <?php echo e($template->name); ?>

                                                </option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    <?php endif; ?>
                                    <div class="quill-editor-container">
                                        <div id="editor-exclusions"></div>
                                    </div>
                                    <input type="hidden" name="exclusions" id="exclusions-input"
                                           value="<?php echo e(old('exclusions', $tour->exclusions)); ?>">
                                    <div class="form-text">Tur fiyatına dahil olmayan hizmetleri belirtin</div>
                                    <?php $__errorArgs = ['exclusions'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- Capacity Section -->
                    <div class="form-section" id="capacity">
                        <div class="section-header">
                            <h3 class="section-title">
                                <i class="fas fa-users section-icon"></i>
                                Kapasite ve Yaş Sınırlamaları
                            </h3>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label">Minimum Katılımcı</label>
                                    <input type="number" name="min_participants" class="form-control"
                                           value="<?php echo e(old('min_participants', $tour->min_participants)); ?>" min="1" required>
                                    <?php $__errorArgs = ['min_participants'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label">Maksimum Katılımcı</label>
                                    <input type="number" name="max_participants" class="form-control"
                                           value="<?php echo e(old('max_participants', $tour->max_participants)); ?>" min="1">
                                    <div class="form-text">Boş bırakırsanız sınırsız olur</div>
                                    <?php $__errorArgs = ['max_participants'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label">Minimum Yaş</label>
                                    <input type="number" name="min_age" class="form-control"
                                           value="<?php echo e(old('min_age', $tour->min_age)); ?>" min="0">
                                    <?php $__errorArgs = ['min_age'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="form-label">Maksimum Yaş</label>
                                    <input type="number" name="max_age" class="form-control"
                                           value="<?php echo e(old('max_age', $tour->max_age)); ?>" min="1">
                                    <?php $__errorArgs = ['max_age'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label class="form-label">Zorluk Seviyesi</label>
                                    <select name="difficulty_level" class="form-select" required>
                                        <option value="easy" <?php echo e(old('difficulty_level', $tour->difficulty_level) === 'easy' ? 'selected' : ''); ?>>
                                            Kolay
                                        </option>
                                        <option value="moderate" <?php echo e(old('difficulty_level', $tour->difficulty_level) === 'moderate' ? 'selected' : ''); ?>>
                                            Orta
                                        </option>
                                        <option value="challenging" <?php echo e(old('difficulty_level', $tour->difficulty_level) === 'challenging' ? 'selected' : ''); ?>>
                                            Zorlu
                                        </option>
                                        <option value="extreme" <?php echo e(old('difficulty_level', $tour->difficulty_level) === 'extreme' ? 'selected' : ''); ?>>
                                            Çok Zorlu
                                        </option>
                                    </select>
                                    <?php $__errorArgs = ['difficulty_level'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- Policies Section -->
                    <div class="form-section" id="policies">
                        <div class="section-header">
                            <h3 class="section-title">
                                <i class="fas fa-file-contract section-icon"></i>
                                Politikalar ve Şartlar
                            </h3>
                        </div>

                        <div class="form-group">
                            <label class="form-label">İptal Politikası</label>
                            <?php if(isset($cancellationPolicies) && $cancellationPolicies->count() > 0): ?>
                                <select class="form-select mb-2" id="cancellationPolicySelect">
                                    <option value="">Şablon Seç (Opsiyonel)</option>
                                    <?php $__currentLoopData = $cancellationPolicies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $template): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($template->id); ?>" data-content="<?php echo e($template->description); ?>">
                                            <?php echo e($template->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            <?php endif; ?>
                            <div class="quill-editor-container">
                                <div id="editor-cancellation-policy"></div>
                            </div>
                            <input type="hidden" name="cancellation_policy" id="cancellation-policy-input"
                                   value="<?php echo e(old('cancellation_policy', $tour->cancellation_policy)); ?>">
                            <?php $__errorArgs = ['cancellation_policy'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="form-group">
                            <label class="form-label">Şartlar ve Koşullar</label>
                            <?php if(isset($termsConditions) && $termsConditions->count() > 0): ?>
                                <select class="form-select mb-2" id="termsConditionsSelect">
                                    <option value="">Şablon Seç (Opsiyonel)</option>
                                    <?php $__currentLoopData = $termsConditions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $template): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($template->id); ?>" data-content="<?php echo e($template->description); ?>">
                                            <?php echo e($template->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            <?php endif; ?>
                            <div class="quill-editor-container">
                                <div id="editor-terms-conditions"></div>
                            </div>
                            <input type="hidden" name="terms_conditions" id="terms-conditions-input"
                                   value="<?php echo e(old('terms_conditions', $tour->terms_conditions)); ?>">
                            <?php $__errorArgs = ['terms_conditions'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="text-danger small mt-1"><?php echo e($message); ?></div>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                    </div>

                    <!-- Actions Bar -->
                    <div class="actions-bar">
                        <div class="actions-bar-info">
                            Son güncelleme: <?php echo e($tour->updated_at->diffForHumans()); ?>

                        </div>
                        <div class="d-flex gap-2">
                            <a href="<?php echo e(route('agency.products.gunubirlik-turlar.index')); ?>" class="btn btn-outline-secondary">
                                İptal
                            </a>
                            <button type="submit" class="btn btn-primary">
                                <i class="fas fa-save me-2"></i>
                                Değişiklikleri Kaydet
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
    <!-- Quill Rich Text Editor JS -->
    <script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            const toolbarOptions = [
                ['bold', 'italic', 'underline', 'strike'],
                ['blockquote', 'code-block'],
                [{'list': 'ordered'}, {'list': 'bullet'}],
                [{'header': [1, 2, 3, 4, 5, 6, false]}],
                [{'color': []}, {'background': []}],
                [{'align': []}],
                ['link'],
                ['clean']
            ];

            // Description Editor
            const descriptionEditor = new Quill('#editor-description', {
                theme: 'snow',
                modules: {toolbar: toolbarOptions},
                placeholder: 'Turun detaylı açıklamasını yazın...'
            });

            const descriptionInput = document.getElementById('description-input');
            if (descriptionInput.value) {
                descriptionEditor.root.innerHTML = descriptionInput.value;
            }
            descriptionEditor.on('text-change', function () {
                descriptionInput.value = descriptionEditor.root.innerHTML;
            });

            // Places to Visit Editor
            const placesToVisitEditor = new Quill('#editor-places-to-visit', {
                theme: 'snow',
                modules: {toolbar: toolbarOptions},
                placeholder: 'Gezilecek yerleri yazın...'
            });

            const placesToVisitInput = document.getElementById('places-to-visit-input');
            if (placesToVisitInput.value) {
                placesToVisitEditor.root.innerHTML = placesToVisitInput.value;
            }
            placesToVisitEditor.on('text-change', function () {
                placesToVisitInput.value = placesToVisitEditor.root.innerHTML;
            });

            // Inclusions Editor
            const inclusionsEditor = new Quill('#editor-inclusions', {
                theme: 'snow',
                modules: {toolbar: toolbarOptions},
                placeholder: 'Dahil olan hizmetleri yazın...'
            });

            const inclusionsInput = document.getElementById('inclusions-input');
            if (inclusionsInput.value) {
                inclusionsEditor.root.innerHTML = inclusionsInput.value;
            }
            inclusionsEditor.on('text-change', function () {
                inclusionsInput.value = inclusionsEditor.root.innerHTML;
            });

            // Exclusions Editor
            const exclusionsEditor = new Quill('#editor-exclusions', {
                theme: 'snow',
                modules: {toolbar: toolbarOptions},
                placeholder: 'Dahil olmayan hizmetleri yazın...'
            });

            const exclusionsInput = document.getElementById('exclusions-input');
            if (exclusionsInput.value) {
                exclusionsEditor.root.innerHTML = exclusionsInput.value;
            }
            exclusionsEditor.on('text-change', function () {
                exclusionsInput.value = exclusionsEditor.root.innerHTML;
            });

            // Cancellation Policy Editor
            const cancellationPolicyEditor = new Quill('#editor-cancellation-policy', {
                theme: 'snow',
                modules: {toolbar: toolbarOptions},
                placeholder: 'İptal politikasını yazın...'
            });

            const cancellationPolicyInput = document.getElementById('cancellation-policy-input');
            if (cancellationPolicyInput.value) {
                cancellationPolicyEditor.root.innerHTML = cancellationPolicyInput.value;
            }
            cancellationPolicyEditor.on('text-change', function () {
                cancellationPolicyInput.value = cancellationPolicyEditor.root.innerHTML;
            });

            // Terms Conditions Editor
            const termsConditionsEditor = new Quill('#editor-terms-conditions', {
                theme: 'snow',
                modules: {toolbar: toolbarOptions},
                placeholder: 'Şartlar ve koşulları yazın...'
            });

            const termsConditionsInput = document.getElementById('terms-conditions-input');
            if (termsConditionsInput.value) {
                termsConditionsEditor.root.innerHTML = termsConditionsInput.value;
            }
            termsConditionsEditor.on('text-change', function () {
                termsConditionsInput.value = termsConditionsEditor.root.innerHTML;
            });

            // Template selects
            const inclusionsTemplateSelect = document.getElementById('inclusionsTemplateSelect');
            if (inclusionsTemplateSelect) {
                inclusionsTemplateSelect.addEventListener('change', function () {
                    const selectedOption = this.options[this.selectedIndex];
                    if (selectedOption.value) {
                        const content = selectedOption.getAttribute('data-content');
                        inclusionsEditor.root.innerHTML = content || '';
                        inclusionsInput.value = content || '';
                    }
                });
            }

            const exclusionsTemplateSelect = document.getElementById('exclusionsTemplateSelect');
            if (exclusionsTemplateSelect) {
                exclusionsTemplateSelect.addEventListener('change', function () {
                    const selectedOption = this.options[this.selectedIndex];
                    if (selectedOption.value) {
                        const content = selectedOption.getAttribute('data-content');
                        exclusionsEditor.root.innerHTML = content || '';
                        exclusionsInput.value = content || '';
                    }
                });
            }

            const cancellationPolicySelect = document.getElementById('cancellationPolicySelect');
            if (cancellationPolicySelect) {
                cancellationPolicySelect.addEventListener('change', function () {
                    const selectedOption = this.options[this.selectedIndex];
                    if (selectedOption.value) {
                        const content = selectedOption.getAttribute('data-content');
                        cancellationPolicyEditor.root.innerHTML = content || '';
                        cancellationPolicyInput.value = content || '';
                    }
                });
            }

            const termsConditionsSelect = document.getElementById('termsConditionsSelect');
            if (termsConditionsSelect) {
                termsConditionsSelect.addEventListener('change', function () {
                    const selectedOption = this.options[this.selectedIndex];
                    if (selectedOption.value) {
                        const content = selectedOption.getAttribute('data-content');
                        termsConditionsEditor.root.innerHTML = content || '';
                        termsConditionsInput.value = content || '';
                    }
                });
            }

        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('agency.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\acente\resources\views/agency/products/gunubirlik-turlar/general.blade.php ENDPATH**/ ?>