<?php $pageTitle = 'Ürün Detayları'; ?>
<?php echo $__env->make("layouts.header", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php
$whmcsFilePath = storage_path('app/public/whmcs_data.json');
if (file_exists($whmcsFilePath)) {
    $whmcs_data = json_decode(file_get_contents($whmcsFilePath), true);
} else {
    $whmcs_data = []; // Dosya bulunamazsa boş array döndür
}

 ?>
 <?php

 function getDomainExtension($domain) {
     $parts = explode('.', $domain);
     $totalParts = count($parts);

     // En az 2 parçalı değilse geçersiz
     if ($totalParts < 2) {
         return false;
     }

     // Eğer son parça 2 harften uzunsa (örnek: 'com', 'org') tek parça uzantıdır
     $tld = $parts[$totalParts - 1];

     // Eğer son parça 2 harfli ise (örnek: 'tr', 'de', 'uk'), iki parçalı uzantı olabilir
     if (strlen($tld) == 2 && $totalParts >= 3) {
         return $parts[$totalParts - 2] . '.' . $tld;
     }

     // Normal tek uzantı
     return $tld;
 }

 ?>
<style media="screen">
    .mbtn {
        width: 24%;
    }

    .label-mobile {
        display: none;
    }

    .label-desktop {
        display: block;
    }

    .label {
        padding: 5px 10px;
        border-radius: 3px;
        font-size: 14px;
        color: white;
        text-align: center;
    }

    .label-default {
        background-color: #777;
    }

    .label-default[href]:hover,
    .label-default[href]:focus {
        background-color: #5e5e5e;
    }

    .label-primary {
        background-color: #337ab7;
    }

    .label-primary[href]:hover,
    .label-primary[href]:focus {
        background-color: #286090;
    }

    .label-success {
        background-color: #5cb85c;
    }

    .label-success[href]:hover,
    .label-success[href]:focus {
        background-color: #449d44;
    }

    .label-info {
        background-color: #5bc0de;
    }

    .label-info[href]:hover,
    .label-info[href]:focus {
        background-color: #31b0d5;
    }

    .label-warning {
        background-color: #f0ad4e;
    }

    .label-warning[href]:hover,
    .label-warning[href]:focus {
        background-color: #ec971f;
    }

    .label-danger {
        background-color: #d9534f;
    }

    .label-danger[href]:hover,
    .label-danger[href]:focus {
        background-color: #c9302c;
    }

    @media only screen and (max-width: 600px) {
        .mr-15 {
            margin-left: 15px;
        }
        .mbtn {
            width: 100%;
            margin-bottom: 5px;
        }
        .label-mobile {
            display: block;
        }
        .label-desktop {
            display: none;
        }
    }
</style>
<?php
  $domain = $product['domains']['domain'][0];
$statusClasses = [
   "Active" => "label-success",
   "Suspended" => "label-warning",
   "Terminated" => "label-danger",
   "Cancelled" => "label-default"
];
$status = $domain['status'];
$cssClass = isset($statusClasses[$status]) ? $statusClasses[$status] : "label-default";
 ?>
    <main class="fi-main mx-auto h-full w-full px-4 md:px-6 lg:px-8 max-w-screen-2xl">
        <div class="fi-page fi-dashboard-page">
            <section class="flex flex-col gap-y-8 py-8">
                <header class="fi-header flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
                    <div>
                        <h1 class="fi-header-heading text-2xl font-bold tracking-tight text-gray-950 dark:text-white sm:text-3xl">
                            Domain Detayları
                        </h1>
                    </div>
                </header>
            </section>
        </div>
            <?php $domain['status'] == 'Expired'; ?>
            <div style="--cols-default: repeat(1, minmax(0, 1fr)); --cols-lg: repeat(<?php if ($domain['status'] == 'Expired'): ?>1<?php else: ?>2<?php endif; ?>, minmax(0, 1fr));" class="grid grid-cols-[--cols-default] lg:grid-cols-[--cols-lg] fi-wi gap-6">
                <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default] fi-wi-widget fi-wi-table">
                    <div class="fi-ta">
                        <div class="fi-ta-ctn divide-y divide-gray-200 overflow-hidden rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:divide-white/10 dark:bg-gray-900 dark:ring-white/10">
                            <div class="fi-ta-header-ctn divide-y divide-gray-200 dark:divide-white/10">
                                <div class="fi-ta-header flex flex-col gap-3 p-4 sm:px-6 sm:flex-row sm:items-center">
                                    <div class="grid gap-y-1">
                                        <h3 class="fi-ta-header-heading text-base font-semibold leading-6 text-gray-950 dark:text-white">
                                            Domain Genel Bakış
                                        </h3>
                                    </div>
                                </div>
                            </div>

                            <div class="fi-ta-content relative divide-y divide-gray-200 overflow-x-auto dark:divide-white/10 dark:border-t-white/10">
                                <div class="">
                                    <div class="px-6 py-4">
                                        <div class="flex items-center">
                                            <div class="bg-gray-200 dark:bg-gray-700 p-4 rounded-full label-desktop">
                                                <svg xmlns="http://www.w3.org/2000/svg" class="h-10 w-10 text-gray-800 dark:text-white" viewBox="0 0 20 20" fill="currentColor">
                                          <path fill-rule="evenodd" d="M4 5a2 2 0 012-2h8a2 2 0 012 2v10a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm2-1a1 1 0 00-1 1v10a1 1 0 001 1h8a1 1 0 001-1V5a1 1 0 00-1-1H6zm4 8a2 2 0 100 4 2 2 0 000-4zm0 1a1 1 0 110 2 1 1 0 010-2z" clip-rule="evenodd" />
                                      </svg>
                                            </div>
                                            <div style="margin-left: 10px;" class="ml-4">
                                                <h1 class="text-xl font-semibold text-gray-900 dark:text-white"><?php echo e($domain['domainname']); ?></h1>
                                                <p class="text-gray-600 dark:text-gray-400">
                                                    <?php
                                        $currentDate = new DateTime();
                                        $nextDueDate = new DateTime($domain['nextduedate']);
                                        $daysRemaining = $currentDate->diff($nextDueDate)->days;
                                        $isPast = $currentDate > $nextDueDate;
                                        if ($isPast) {
                                          echo "Bu alan adının süresi $daysRemaining gün önce doldu...</p>";
                                        } else {
                                          echo "Bu alan adının süresi $daysRemaining gün sonra bitiyor...</p>";
                                        }
                                         ?>
                                                </p>
                                            </div>

                                            <form action="<?php echo e(route('domain.save')); ?>" method="POST" class="hostingrenew-form" style="display: contents;">
                                              <?php echo csrf_field(); ?>
                                              <input type="hidden" name="action" value="domainrenew">
                                              <input type="hidden" name="domainid" value="<?php echo $product['domainid']; ?>">
                                              <input type="hidden" name="domainname" value="<?php echo $domain['domainname']; ?>">
                                              <select name="period" style="text-align: center; --c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);" class="mbtn fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500 dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50 fi-ac-action fi-ac-btn-action">
                                                <option selected disabled>Süre Uzat</option>
                                                  <?php
                                                  $tldPricing = $whmcs_data['tldPricing']['pricing']; // TLD verilerini al

                                                  $turkish_cycles = [
                                                    1 => '1 Yıllık',
                                                    2 => '2 Yıllık',
                                                    3 => '3 Yıllık',
                                                    4 => '4 Yıllık',
                                                    5 => '5 Yıllık',
                                                    6 => '6 Yıllık',
                                                    7 => '7 Yıllık',
                                                    8 => '8 Yıllık',
                                                    9 => '9 Yıllık',
                                                    10 => '10 Yıllık'
                                                  ];

                                                  // Örneğin "ARMY" uzantısı için:
                                                  $tld = getDomainExtension($domain['domainname']); // bu kısmı dinamikleştirebilirsin

                                                  if (isset($tldPricing[$tld]['renew'])) {
                                                    foreach ($tldPricing[$tld]['renew'] as $year => $price) {
                                                      if ($price > 0) {
                                                        $label = isset($turkish_cycles[$year]) ? $turkish_cycles[$year] : $year . ' Yıllık';
                                                        echo "<option value=\"{$year}\">{$label} (\${$price})</option>";
                                                      }
                                                    }
                                                  }
                                                  ?>
                                              </select>
                                            </form>
                                            <span class="label-desktop label <?php echo $cssClass; ?> ml-auto bg-green-200 text-green-800 px-3 py-1 rounded-full text-sm">

                                    <?php
                                    if ($domain['status'] == "Active") {
                                      echo "Aktif";
                                    }
                                    if ($domain['status'] == "Expired") {
                                      echo "Süresi Doldu";
                                    }
                                    if ($domain['status'] == "Terminated") {
                                      echo "Kapatıldı";
                                    }
                                    if ($domain['status'] == "Cancelled") {
                                      echo "İptal Edildi";
                                    }
                                     ?>
                                  </span>
                                        </div>
                                        <div style="margin-top:10px;" class="mt-4">
                                            <span style="margin-bottom:5px;border-radius: .5rem;" class="label-mobile label <?php echo $cssClass; ?> ml-auto bg-green-200 text-green-800 px-3 py-1 rounded-full text-sm">
                                  <?php

                                  if ($domain['status'] == "Active") {
                                    echo "Aktif";
                                  }
                                  if ($domain['status'] == "Expired") {
                                    echo "Süresi Doldu";
                                  }
                                  if ($domain['status'] == "Terminated") {
                                    echo "Kapatıldı";
                                  }
                                  if ($domain['status'] == "Cancelled") {
                                    echo "İptal Edildi";
                                  }
                                   ?>
                                </span>
                                        </div>
                                    </div>
                                    <div class="border-t dark:border-gray-700">
                                        <dl class="divide-y divide-gray-200 dark:divide-gray-700">
                                            <div class="py-2 px-6 flex justify-between">
                                                <dt class="text-gray-600 dark:text-gray-400">Yenileme Tutarı</dt>
                                                <dd class="font-medium text-gray-900 dark:text-gray-200">$<?php echo e($domain['recurringamount']); ?></dd>
                                            </div>
                                            <div class="py-2 px-6 flex justify-between">
                                                <dt class="text-gray-600 dark:text-gray-400">Sonraki Yenileme Tarihi</dt>
                                                <dd class="font-medium text-gray-900 dark:text-gray-200">
                                                    <?php echo date_format(date_create($domain['nextduedate']), "d/m/Y"); ?>
                                                </dd>
                                            </div>
                                            <div class="py-2 px-6 flex justify-between">
                                                <dt class="text-gray-600 dark:text-gray-400">Ödeme şekli</dt>
                                                <dd class="font-medium text-gray-900 dark:text-gray-200">
                                                    <?php
                                                    if ($domain['paymentmethod'] == "banktransfer") {
                                                      echo "Banka Transferi";
                                                    }
                                                    if ($domain['paymentmethod'] == "paytr") {
                                                      echo "Kredi Kartı";
                                                    }
                                                    ?>
                                                </dd>
                                            </div>
                                            <div class="py-2 px-6 flex justify-between">
                                                <dt class="text-gray-600 dark:text-gray-400">Kayıt Tarihi</dt>
                                                <dd class="font-medium text-gray-900 dark:text-gray-200">
                                                    <?php echo date_format(date_create($domain['regdate']), "d/m/Y"); ?>
                                                </dd>
                                            </div>
                                            <div class="py-2 px-6 flex justify-between">
                                                <dt class="text-gray-600 dark:text-gray-400">Bitiş Tarihi</dt>
                                                <dd class="font-medium text-gray-900 dark:text-gray-200">
                                                    <?php echo date_format(date_create($domain['expirydate']), "d/m/Y"); ?>
                                                </dd>
                                            </div>
                                        </dl>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <?php if ($domain['status'] == 'Active'): ?>

                <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default] fi-wi-widget fi-wi-table">
                    <div class="fi-ta">
                        <div class="fi-ta-ctn divide-y divide-gray-200 overflow-hidden rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:divide-white/10 dark:bg-gray-900 dark:ring-white/10">
                            <div class="fi-ta-header-ctn divide-y divide-gray-200 dark:divide-white/10">
                                <div class="fi-ta-header flex flex-col gap-3 p-4 sm:px-6 sm:flex-row sm:items-center">
                                    <div class="grid gap-y-1">
                                        <h3 class="fi-ta-header-heading text-base font-semibold leading-6 text-gray-950 dark:text-white">
                                            Domain Yönetim Kısayolları
                                        </h3>
                                    </div>
                                </div>
                            </div>

                            <div class="fi-ta-content relative divide-y divide-gray-200 overflow-x-auto dark:divide-white/10 dark:border-t-white/10">
                                <div class="">
                                    <div class="mb-4">
                                      <div style="margin-right: 20px; margin-left: 20px; margin-top: 10px;" id="nameserver-save-button" class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-4 mb-4 cursor-pointer">
                                        <div class="flex justify-between items-center">
                                          <h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">NameServer Güncelle</h2>
                                          <button class="text-blue-500 hover:text-blue-700 dark:text-blue-300 dark:hover:text-blue-500">+</button>
                                        </div>
                                      </div>
                                        <form id="nameserver-save-form" action="<?php echo e(route('domain.save')); ?>" method="post" class="nameserver-form hidden">
                                            <?php echo csrf_field(); ?>
                                            <input type="hidden" name="action" value="updateNameservers">
                                            <input type="hidden" name="domainid" value="<?php echo e($product['domainid']); ?>">
                                          <div style="--cols-default: repeat(1, minmax(0, 1fr)); --cols-lg: repeat(2, minmax(0, 1fr)); --cols-xl: repeat(2, minmax(0, 1fr));padding-right:30px;padding-left:30px;" class="grid grid-cols-[--cols-default] lg:grid-cols-[--cols-lg] xl:grid-cols-[--cols-xl] fi-fo-component-ctn gap-6">

                                              <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default]">
                                                  <div data-field-wrapper="" class="fi-fo-field-wrp">
                                                      <div class="grid gap-y-2">
                                                          <div class="flex items-center gap-x-3 justify-between">
                                                              <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                                <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
                                                                  NameServer 1
                                                                </span>
                                                              </label>
                                                            </div>

                                                            <div class="grid auto-cols-fr gap-y-2">
                                                              <div class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-2 ring-gray-950/10 dark:ring-white/20 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-600 dark:[&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-500 fi-fo-text-input overflow-hidden">
                                                                  <div class="min-w-0 flex-1">
                                                                      <input name="nameserver1" value="<?php if (isset($dna['data']['NameServers'][0])): echo $dna['data']['NameServers'][0]; endif; ?>" class="fi-input block w-full border-none py-1.5 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.400)] dark:text-white dark:placeholder:text-gray-500dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] dark:disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.500)] sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3"
                                                                          type="text" />
                                                                        </div>
                                                                      </div>
                                                                    </div>
                                                                  </div>
                                                                </div>
                                                              </div>
                                                              <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default]">
                                                                <div data-field-wrapper="" class="fi-fo-field-wrp">
                                                                  <div class="grid gap-y-2">
                                                                    <div class="flex items-center gap-x-3 justify-between">
                                                                      <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                                        <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
                                                                          NameServer 2
                                                                        </span>
                                                                      </label>
                                                                    </div>

                                                                    <div class="grid auto-cols-fr gap-y-2">
                                                                      <div class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-2 ring-gray-950/10 dark:ring-white/20 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-600 dark:[&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-500 fi-fo-text-input overflow-hidden">
                                                                        <div class="min-w-0 flex-1">
                                                                          <input name="nameserver2" value="<?php if (isset($dna['data']['NameServers'][1])): echo $dna['data']['NameServers'][1]; endif; ?>" class="fi-input block w-full border-none py-1.5 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.400)] dark:text-white dark:placeholder:text-gray-500dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] dark:disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.500)] sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3"
                                                                            type="text" />
                                                                          </div>
                                                                        </div>
                                                                      </div>
                                                                    </div>
                                                                  </div>
                                                                </div>
                                                                <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default]">
                                                                  <div data-field-wrapper="" class="fi-fo-field-wrp">
                                                                    <div class="grid gap-y-2">
                                                                      <div class="flex items-center gap-x-3 justify-between">
                                                                        <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                                          <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
                                                                            NameServer 3
                                                                          </span>
                                                                        </label>
                                                                      </div>

                                                                      <div class="grid auto-cols-fr gap-y-2">
                                                                        <div class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-2 ring-gray-950/10 dark:ring-white/20 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-600 dark:[&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-500 fi-fo-text-input overflow-hidden">
                                                                          <div class="min-w-0 flex-1">
                                                                            <input name="nameserver3" value="<?php if (isset($dna['data']['NameServers'][2])): echo $dna['data']['NameServers'][2]; endif; ?>" class="fi-input block w-full border-none py-1.5 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.400)] dark:text-white dark:placeholder:text-gray-500dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] dark:disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.500)] sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3"
                                                                              type="text" />
                                                                            </div>
                                                                          </div>
                                                                        </div>
                                                                      </div>
                                                                    </div>
                                                                  </div>

                                                                  <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default]">
                                                                    <div data-field-wrapper="" class="fi-fo-field-wrp">
                                                                      <div class="grid gap-y-2">
                                                                        <div class="flex items-center gap-x-3 justify-between">
                                                                          <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                                            <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
                                                                              NameServer 4
                                                                            </span>
                                                                          </label>
                                                                        </div>

                                                                        <div class="grid auto-cols-fr gap-y-2">
                                                                          <div class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-2 ring-gray-950/10 dark:ring-white/20 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-600 dark:[&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-500 fi-fo-text-input overflow-hidden">
                                                                            <div class="min-w-0 flex-1">
                                                                              <input name="nameserver4" value="<?php if (isset($dna['data']['NameServers'][3])): echo $dna['data']['NameServers'][3]; endif; ?>" class="fi-input block w-full border-none py-1.5 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.400)] dark:text-white dark:placeholder:text-gray-500dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] dark:disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.500)] sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3"
                                                                                type="text" />
                                                                              </div>
                                                                            </div>
                                                                          </div>
                                                                        </div>
                                                                      </div>
                                                                    </div>
                                                                  </div>
                                            <div id="response-message">
                                              <div id="lockedstatus-message" style="display: none; padding-left: 30px; padding-right: 30px; margin-top: 10px;">
                                                <div class="flex items-center p-4 mb-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400" role="alert">
                                                  <svg style="margin-right: 10px;" class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
                                                    <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
                                                  </svg>
                                                  <span class="sr-only">Info</span>
                                                  <div>
                                                    <span class="font-medium">Başarılı! </span> <span id="lockedstatus-message-text"></span>
                                                  </div>
                                                </div>
                                              </div>
                                              <div id="lockederror-message" style="display: none; padding-left: 30px; padding-right: 30px; margin-top: 10px;">
                                                <div class="flex items-center p-4 mb-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300" role="alert">
                                                  <svg style="margin-right: 10px;" class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
                                                    <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
                                                  </svg>
                                                  <span class="sr-only">Info</span>
                                                  <div>
                                                    <span class="font-medium">Hata! </span> <span id="lockederror-message-text"></span>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                            <div style="padding-left:30px;padding-right: 30px;margin-top: 10px;">
                                                <button style="width: 100%;--c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);" class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500 dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50 fi-ac-action fi-ac-btn-action">Kaydet</button>
                                            </div>
                                        </form>
                                    </div>
                                      <div class="mb-4">
                                        <div id="addnameserver-button" style="margin-right: 20px; margin-left: 20px;" class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-4 mb-4 cursor-pointer">
                                          <div class="flex justify-between items-center">
                                            <h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Alt NameServer Kaydet</h2>
                                            <button class="text-blue-500 hover:text-blue-700 dark:text-blue-300 dark:hover:text-blue-500">+</button>
                                          </div>
                                        </div>
                                        <form id="addnameserver-form" action="<?php echo e(route('domain.save')); ?>" method="post" class="addnameserver-form hidden">
                                          <?php echo csrf_field(); ?>
                                          <input type="hidden" name="action" value="addnameserver" />
                                          <input type="hidden" name="domainname" value="<?php echo e($domain['domainname']); ?>" />
                                          <div style="--cols-default: repeat(1, minmax(0, 1fr)); --cols-lg: repeat(2, minmax(0, 1fr)); --cols-xl: repeat(2, minmax(0, 1fr)); padding-right: 30px; padding-left: 30px;" class="grid grid-cols-[--cols-default] lg:grid-cols-[--cols-lg] xl:grid-cols-[--cols-xl] fi-fo-component-ctn gap-6">
                                            <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default]">
                                              <div data-field-wrapper="" class="fi-fo-field-wrp">
                                                <div class="grid gap-y-2">
                                                  <div class="flex items-center gap-x-3 justify-between">
                                                    <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                      <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
                                                        NameServer (Örnek: ns1)
                                                      </span>
                                                    </label>
                                                  </div>
                                                  <div class="grid auto-cols-fr gap-y-2">
                                                    <div class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-2 ring-gray-950/10 dark:ring-white/20 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-600 dark:[&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-500 fi-fo-text-input overflow-hidden">
                                                      <div class="min-w-0 flex-1">
                                                        <input name="nameserver" class="fi-input block w-full border-none py-1.5 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.400)] dark:text-white dark:placeholder:text-gray-500dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] dark:disabled:placeholder:[- webkit- text-fill-color:theme(colors.gray.500)] sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3" type="text" />
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                            <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default]">
                                              <div data-field-wrapper="" class="fi-fo-field-wrp">
                                                <div class="grid gap-y-2">
                                                  <div class="flex items-center gap-x-3 justify-between">
                                                    <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                      <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
                                                        IP Adresi (Örnek: 1.2.3.4)
                                                      </span>
                                                    </label>
                                                  </div>
                                                  <div class="grid auto-cols-fr gap-y-2">
                                                    <div class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-2 ring-gray-950/10 dark:ring-white/20 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-600 dark:[&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-500 fi-fo-text-input overflow-hidden">
                                                      <div class="min-w-0 flex-1">
                                                        <input name="nameserverip" class="fi-input block w-full border-none py-1.5 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.400)] dark:text-white dark:placeholder:text-gray-500dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] dark:disabled:placeholder:[- webkit- text-fill-color:theme(colors.gray.500)] sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3" type="text" />
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                          <div id="response-message">
                                            <div id="addnameserverstatus-message" style="display: none; padding-left: 30px; padding-right: 30px; margin-top: 10px;">
                                              <div class="flex items-center p-4 mb-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400" role="alert">
                                                <svg style="margin-right: 10px;" class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
                                                  <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
                                                </svg>
                                                <span class="sr-only">Info</span>
                                                <div><span class="font-medium">Başarılı! </span> <span id="addnameserverstatus-message-text"></span></div>
                                              </div>
                                            </div>
                                            <div id="addnameservererror-message" style="display: none; padding-left: 30px; padding-right: 30px; margin-top: 10px;">
                                              <div class="flex items-center p-4 mb-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300" role="alert">
                                                <svg style="margin-right: 10px;" class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
                                                  <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
                                                </svg>
                                                <span class="sr-only">Info</span>
                                                <div><span class="font-medium">Hata! </span> <span id="addnameservererror-message-text"></span></div>
                                              </div>
                                            </div>
                                          </div>
                                          <div style="padding-left: 30px; padding-right: 30px; margin-top: 10px;">
                                            <button style="width: 100%; --c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);" class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500   dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50 fi-ac-action fi-ac-btn-action">
                                              Kaydet
                                            </button>
                                          </div>
                                        </form>
                                      </div>
                                      <div class="mb-4">
                                        <div id="updateaddnameserver-button" style="margin-right: 20px; margin-left: 20px;" class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-4 mb-4 cursor-pointer">
                                          <div class="flex justify-between items-center">
                                            <h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Alt NameServer Güncelle</h2>
                                            <button class="text-blue-500 hover:text-blue-700 dark:text-blue-300 dark:hover:text-blue-500">+</button>
                                          </div>
                                        </div>
                                        <form id="updateaddnameserver-form" action="<?php echo e(route('domain.save')); ?>" method="post" class="updateaddnameserver-form hidden">
                                          <?php echo csrf_field(); ?>
                                          <input type="hidden" name="action" value="updateaddnameserver" />
                                          <input type="hidden" name="domainname" value="<?php echo e($domain['domainname']); ?>" />
                                          <div style="--cols-default: repeat(1, minmax(0, 1fr)); --cols-lg: repeat(2, minmax(0, 1fr)); --cols-xl: repeat(2, minmax(0, 1fr)); padding-right: 30px; padding-left: 30px;" class="grid grid-cols-[--cols-default] lg:grid-cols-[--cols-lg] xl:grid-cols-[--cols-xl] fi-fo-component-ctn gap-6">
                                            <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default]">
                                              <div data-field-wrapper="" class="fi-fo-field-wrp">
                                                <div class="grid gap-y-2">
                                                  <div class="flex items-center gap-x-3 justify-between">
                                                    <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                      <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
                                                        NameServer (Örnek: ns1)
                                                      </span>
                                                    </label>
                                                  </div>
                                                  <div class="grid auto-cols-fr gap-y-2">
                                                    <div class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-2 ring-gray-950/10 dark:ring-white/20 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-600 dark:[&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-500 fi-fo-text-input overflow-hidden">
                                                      <div class="min-w-0 flex-1">
                                                        <input name="nameserver" class="fi-input block w-full border-none py-1.5 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.400)] dark:text-white dark:placeholder:text-gray-500dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] dark:disabled:placeholder:[- webkit- text-fill-color:theme(colors.gray.500)] sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3" type="text" />
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                            <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default]">
                                              <div data-field-wrapper="" class="fi-fo-field-wrp">
                                                <div class="grid gap-y-2">
                                                  <div class="flex items-center gap-x-3 justify-between">
                                                    <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                      <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
                                                        IP Adresi (Örnek: 1.2.3.4)
                                                      </span>
                                                    </label>
                                                  </div>
                                                  <div class="grid auto-cols-fr gap-y-2">
                                                    <div class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-2 ring-gray-950/10 dark:ring-white/20 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-600 dark:[&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-500 fi-fo-text-input overflow-hidden">
                                                      <div class="min-w-0 flex-1">
                                                        <input name="nameserverip" class="fi-input block w-full border-none py-1.5 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.400)] dark:text-white dark:placeholder:text-gray-500dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] dark:disabled:placeholder:[- webkit- text-fill-color:theme(colors.gray.500)] sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3" type="text" />
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                          <div id="response-message">
                                            <div id="updateaddnameserverstatus-message" style="display: none; padding-left: 30px; padding-right: 30px; margin-top: 10px;">
                                              <div class="flex items-center p-4 mb-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400" role="alert">
                                                <svg style="margin-right: 10px;" class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
                                                  <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
                                                </svg>
                                                <span class="sr-only">Info</span>
                                                <div><span class="font-medium">Başarılı! </span> <span id="updateaddnameserverstatus-message-text"></span></div>
                                              </div>
                                            </div>
                                            <div id="updateaddnameservererror-message" style="display: none; padding-left: 30px; padding-right: 30px; margin-top: 10px;">
                                              <div class="flex items-center p-4 mb-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300" role="alert">
                                                <svg style="margin-right: 10px;" class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
                                                  <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
                                                </svg>
                                                <span class="sr-only">Info</span>
                                                <div><span class="font-medium">Hata! </span> <span id="updateaddnameservererror-message-text"></span></div>
                                              </div>
                                            </div>
                                          </div>
                                          <div style="padding-left: 30px; padding-right: 30px; margin-top: 10px;">
                                            <button style="width: 100%; --c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);" class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500   dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50 fi-ac-action fi-ac-btn-action">
                                              Kaydet
                                            </button>
                                          </div>
                                        </form>
                                      </div>
                                      <div class="mb-4">
                                        <div id="deleteaddnameserver-button" style="margin-right: 20px; margin-left: 20px;" class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-4 mb-4 cursor-pointer">
                                          <div class="flex justify-between items-center">
                                            <h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Alt NameServer Silme</h2>
                                            <button class="text-blue-500 hover:text-blue-700 dark:text-blue-300 dark:hover:text-blue-500">+</button>
                                          </div>
                                        </div>
                                        <form id="deleteaddnameserver-form" action="<?php echo e(route('domain.save')); ?>" method="post" class="deleteaddnameserver-form hidden">
                                          <?php echo csrf_field(); ?>
                                          <input type="hidden" name="action" value="deleteaddnameserver" />
                                          <input type="hidden" name="domainname" value="<?php echo e($domain['domainname']); ?>" />
                                          <div style="--cols-default: repeat(1, minmax(0, 1fr)); --cols-lg: repeat(1, minmax(0, 1fr)); --cols-xl: repeat(1, minmax(0, 1fr)); padding-right: 30px; padding-left: 30px;" class="grid grid-cols-[--cols-default] lg:grid-cols-[--cols-lg] xl:grid-cols-[--cols-xl] fi-fo-component-ctn gap-6">
                                            <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default]">
                                              <div data-field-wrapper="" class="fi-fo-field-wrp">
                                                <div class="grid gap-y-2">
                                                  <div class="flex items-center gap-x-3 justify-between">
                                                    <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                      <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
                                                        NameServer (Örnek: ns1)
                                                      </span>
                                                    </label>
                                                  </div>
                                                  <div class="grid auto-cols-fr gap-y-2">
                                                    <div class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-2 ring-gray-950/10 dark:ring-white/20 [&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-600 dark:[&amp;:not(:has(.fi-ac-action:focus))]:focus-within:ring-primary-500 fi-fo-text-input overflow-hidden">
                                                      <div class="min-w-0 flex-1">
                                                        <input name="nameserver" class="fi-input block w-full border-none py-1.5 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.400)] dark:text-white dark:placeholder:text-gray-500dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] dark:disabled:placeholder:[- webkit- text-fill-color:theme(colors.gray.500)] sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3" type="text" />
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                          <div id="response-message">
                                            <div id="deleteaddnameserverstatus-message" style="display: none; padding-left: 30px; padding-right: 30px; margin-top: 10px;">
                                              <div class="flex items-center p-4 mb-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400" role="alert">
                                                <svg style="margin-right: 10px;" class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
                                                  <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
                                                </svg>
                                                <span class="sr-only">Info</span>
                                                <div><span class="font-medium">Başarılı! </span> <span id="deleteaddnameserverstatus-message-text"></span></div>
                                              </div>
                                            </div>
                                            <div id="deleteaddnameservererror-message" style="display: none; padding-left: 30px; padding-right: 30px; margin-top: 10px;">
                                              <div class="flex items-center p-4 mb-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300" role="alert">
                                                <svg style="margin-right: 10px;" class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
                                                  <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
                                                </svg>
                                                <span class="sr-only">Info</span>
                                                <div><span class="font-medium">Hata! </span> <span id="deleteaddnameservererror-message-text"></span></div>
                                              </div>
                                            </div>
                                          </div>
                                          <div style="padding-left: 30px; padding-right: 30px; margin-top: 10px;">
                                            <button style="width: 100%; --c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);" class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500   dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50 fi-ac-action fi-ac-btn-action">
                                              Kaydet
                                            </button>
                                          </div>
                                        </form>
                                      </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <?php endif; ?>
            </div>
            <?php if ($domain['status'] == "Active"): ?>
            <div style="--cols-default: repeat(1, minmax(0, 1fr)); --cols-lg: repeat(2, minmax(0, 1fr));margin-top:25px;" class="grid grid-cols-[--cols-default] lg:grid-cols-[--cols-lg] fi-wi gap-6">
                <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default] fi-wi-widget fi-wi-table">
                    <div class="fi-ta">
                        <div class="fi-ta-ctn divide-y divide-gray-200 overflow-hidden rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:divide-white/10 dark:bg-gray-900 dark:ring-white/10">
                            <div class="fi-ta-header-ctn divide-y divide-gray-200 dark:divide-white/10">
                                <div class="fi-ta-header flex flex-col gap-3 p-4 sm:px-6 sm:flex-row sm:items-center">
                                    <div class="grid gap-y-1">
                                        <h3 class="fi-ta-header-heading text-base font-semibold leading-6 text-gray-950 dark:text-white">
                                            Whois Bilgisi
                                        </h3>
                                    </div>
                                </div>
                            </div>
                            <div class="fi-ta-content relative divide-y divide-gray-200 overflow-x-auto dark:divide-white/10 dark:border-t-white/10">
                                <div class="">
                                  <div class="border-t dark:border-gray-700">
  <dl class="divide-y divide-gray-200 dark:divide-gray-700 mr-15">

      <!-- İsim -->
      <div class="py-2 px-6 flex justify-between">
          <dt class="text-gray-600 dark:text-gray-400">İsim</dt>
          <dd class="font-medium text-gray-900 dark:text-gray-200">
              <?php
              echo isset(
                  $whois['RegistrantContact']['First_Name'],
                  $whois['RegistrantContact']['Last_Name']
              )
                  ? $whois['RegistrantContact']['First_Name'] . ' ' . $whois['RegistrantContact']['Last_Name']
                  : 'Kayıtlı veri bulunamadı';
              ?>
          </dd>
      </div>

      <!-- Şirket -->
      <div class="py-2 px-6 flex justify-between">
          <dt class="text-gray-600 dark:text-gray-400">Şirket</dt>
          <dd class="font-medium text-gray-900 dark:text-gray-200">
              <?php
              $company = $whois['RegistrantContact']['Company_Name'] ?? null;
              echo (!$company || $company === 'n/a')
                  ? 'Kayıtlı veri bulunamadı'
                  : $company;
              ?>
          </dd>
      </div>

      <!-- Email -->
      <div class="py-2 px-6 flex justify-between">
          <dt class="text-gray-600 dark:text-gray-400">Email</dt>
          <dd class="font-medium text-gray-900 dark:text-gray-200">
              <?php
              echo $whois['RegistrantContact']['Email']
                  ?? 'Kayıtlı veri bulunamadı';
              ?>
          </dd>
      </div>

      <!-- Telefon -->
      <div class="py-2 px-6 flex justify-between">
          <dt class="text-gray-600 dark:text-gray-400">Telefon</dt>
          <dd class="font-medium text-gray-900 dark:text-gray-200">
              <?php
              if (
                  isset(
                      $whois['RegistrantContact']['Phone_Country_Code'],
                      $whois['RegistrantContact']['Phone']
                  )
              ) {
                  echo '+' .
                      $whois['RegistrantContact']['Phone_Country_Code'] .
                      ' ' .
                      $whois['RegistrantContact']['Phone'];
              } else {
                  echo 'Kayıtlı veri bulunamadı';
              }
              ?>
          </dd>
      </div>

      <!-- Adres -->
      <div class="py-2 px-6 flex justify-between">
          <dt class="text-gray-600 dark:text-gray-400">Adres</dt>
          <dd class="font-medium text-gray-900 dark:text-gray-200">
              <?php
              if (isset($whois['RegistrantContact'])) {
                  echo trim(
                      ($whois['RegistrantContact']['Address_1'] ?? '') . ', ' .
                      ($whois['RegistrantContact']['State'] ?? '') . ', ' .
                      ($whois['RegistrantContact']['City'] ?? '') . ', ' .
                      ($whois['RegistrantContact']['Country'] ?? '') . ' ' .
                      ($whois['RegistrantContact']['ZIP_Code'] ?? '')
                  , ', ');
              } else {
                  echo 'Kayıtlı veri bulunamadı';
              }
              ?>
          </dd>
      </div>

  </dl>
</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default] fi-wi-widget fi-wi-table">
                    <div class="fi-ta">
                        <div class="fi-ta-ctn divide-y divide-gray-200 overflow-hidden rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:divide-white/10 dark:bg-gray-900 dark:ring-white/10">
                            <div class="fi-ta-header-ctn divide-y divide-gray-200 dark:divide-white/10">
                                <div class="fi-ta-header flex flex-col gap-3 p-4 sm:px-6 sm:flex-row sm:items-center">
                                    <div class="grid gap-y-1">
                                        <h3 class="fi-ta-header-heading text-base font-semibold leading-6 text-gray-950 dark:text-white">
                                            Diğer Yönetim Kısayolları
                                        </h3>
                                    </div>
                                </div>
                            </div>
                        <div class="fi-ta-content relative divide-y divide-gray-200 overflow-x-auto dark:divide-white/10 dark:border-t-white/10">
                            <div class="">
                                <div class="border-t dark:border-gray-700">
                                  <div class="mb-4">
                                      <div class="bg-white dark:bg-gray-900 dark:text-white p-4 rounded-b shadow">
                                          <div class="flex justify-between items-center">
                                              <div class="flex items-center">
                                                <span id="lock-status-label" style="margin-right:10px;" class="label <?php echo e($dna['data']['LockStatus'] == 'true' ? 'label-success' : 'label-danger'); ?> bg-green-500 text-white p-2 rounded mr-2"><?php echo e($dna['data']['LockStatus'] == 'locked' ? 'Aktif' : 'Pasif'); ?></span>
                                                  <span class="font-bold text-xl">Transfer Kilidi</span>
                                              </div>
                                              <form action="<?php echo e(route('domain.save')); ?>" method="POST" class="inline locked-form">
                                                  <?php echo csrf_field(); ?>
                                                  <input type="hidden" name="action" value="toggleLock">
                                                  <input type="hidden" name="domainid" value="<?php echo e($product['domainid']); ?>">
                                                  <button style="--c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);" class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500 dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50 fi-ac-action fi-ac-btn-action"><?php echo e($dna['data']['LockStatus'] == 'true' ? 'Devre Dışı Bırak' : 'Aktif Edin'); ?></button>

                                              </form>
                                          </div>
                                          <p class="mt-2 font-medium text-gray-900 dark:text-gray-200">Transfer Kilidi Aktif Et (Önerilir). Kilidin etkin olması durumunda izinsiz transferler engellenmiş olacaktır.</p>
                                      </div>
                                  </div>
                                    <div class="mb-4 epp-form-mb">
                                        <div class="bg-white dark:bg-gray-900 dark:text-white p-4 rounded-b shadow">
                                            <div class="flex justify-between items-center">
                                                <div class="flex items-center">
                                                    <span class="font-bold text-xl">Transfer Kodu Al</span>
                                                  </div>
                                                  <form action="<?php echo e(route('domain.save')); ?>" method="POST" class="inline epp-form">
                                                    <?php echo csrf_field(); ?>
                                                    <input type="hidden" name="action" value="createepp">
                                                    <input type="hidden" name="domainid" value="<?php echo e($product['domainid']); ?>">
                                                    <button style="--c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);display:none;" class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ringcustom-500/50 dark:bg-custom-500 dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50 fi-ac-action fi-ac-btn-action"
                                                        <?php echo e($dna['data']['LockStatus'] == 'true' ? 'disabled' : ''); ?>>
                                                        Transfer Kodu Al
                                                      </button>
                                                      <button style="--c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);" class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ringcustom-500/50 dark:bg-custom-500 dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50 fi-ac-action fi-ac-btn-action" onclick="window.dialog.showModal();">Transfer Kodu Al</button>
                                                    </form>
                                                  </div>
                                                  <p class="mt-2 font-medium text-gray-900 dark:text-gray-200">Transfer etmek istediğiniz domain adresinizin önce transfer kilidini açmanız gerekmektedir.</p>
                                                </div>
                                              </div>
                                              <div class="mb-4">
                                                  <div class="bg-white dark:bg-gray-900 dark:text-white p-4 rounded-b shadow">
                                                      <div class="flex justify-between items-center">
                                                          <div class="flex items-center">
                                                            <span id="renew-status-label" style="margin-right:10px;" class="label <?php echo e($domain['donotrenew'] == '0' ? 'label-success' : 'label-danger'); ?> bg-green-500 text-white p-2 rounded mr-2"><?php echo e($domain['donotrenew'] == '0' ? 'Aktif' : 'Pasif'); ?></span>
                                                              <span class="font-bold text-xl">Otomatik Yenileme</span>
                                                          </div>
                                                          <form action="<?php echo e(route('domain.save')); ?>" method="POST" class="inline renew-form">
                                                              <?php echo csrf_field(); ?>
                                                              <input type="hidden" name="action" value="autorenew">
                                                              <input type="hidden" name="autorenew" value="<?php echo e($domain['donotrenew'] == '0' ? '1' : '0'); ?>">
                                                              <input type="hidden" name="domainid" value="<?php echo e($product['domainid']); ?>">
                                                              <button style="--c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);" class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500 dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50 fi-ac-action fi-ac-btn-action">
                                                                  <?php echo e($domain['donotrenew'] == '0' ? 'Devre Dışı Bırak' : 'Aktif Edin'); ?>

                                                              </button>
                                                          </form>

                                                      </div>
                                                      <p class="mt-2 font-medium text-gray-900 dark:text-gray-200">Otomatik yenilemeyi açarak, alan adınızın süresi bitmeden tarafınıza e-posta ile yenileme faturası gönderilmesini sağlayabilirsiniz.</p>
                                                  </div>
                                              </div>
                                                <?php if($dns['exists'] && $dns['is_whmcs']): ?>
                                              <div class="mb-4">
                                                  <div class="bg-white dark:bg-gray-900 dark:text-white p-4 rounded-b shadow">
                                                      <div class="flex justify-between items-center">
                                                          <div class="flex items-center">
                                                            <span id="renew-status-label" style="margin-right:10px;" class="label  label-success bg-green-500 text-white p-2 rounded mr-2"><svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" />
                                                            </svg></span>
                                                              <span class="font-bold text-xl">DNS Yönetimi</span>
                                                          </div>
                                                          <button
                                                              type="button"
                                                              onclick="window.dnsDialog.showModal()"
                                                              style="--c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);"
                                                              class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500 dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50"
                                                          >
                                                              <svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                                  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" />
                                                              </svg>
                                                              <span class="fi-btn-label">DNS Yönet</span>
                                                          </button>
                                                      </div>
                                                      <p class="mt-2 font-medium text-gray-900 dark:text-gray-200">
                                                        <b>DNS kayıtlarınızı hızlı, güvenli ve merkezi bir şekilde yönetin.</b><br>
                                                        Alan adınıza ait tüm DNS ayarlarını tek panelden düzenleyin, değişiklikleri anında uygulayın.
                                                      </p>
                                                  </div>
                                              </div>
                                              <?php endif; ?>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                                <style media="screen">

                                dialog {
                                  min-width: 30%;

                                background: white;
                                max-width: 400px;
                                padding-top: 2rem;
                                border-radius: 20px;
                                border: 0;
                                box-shadow: 0 5px 30px 0 rgb(0 0 0 / 10%);
                                animation: fadeIn 1s ease both;
                                &::backdrop {
                                  animation: fadeIn 1s ease both;
                                  background: rgb(255 255 255 / 40%);
                                  z-index: 2;
                                  backdrop-filter: blur(20px);
                                }
                                .x {
                                  filter: grayscale(1);
                                  border: none;
                                  background: none;
                                  position: absolute;
                                  top: 15px;
                                  right: 10px;
                                  transition: ease filter, transform 0.3s;
                                  cursor: pointer;
                                  transform-origin: center;
                                  &:hover {
                                    filter: grayscale(0);
                                    transform: scale(1.1);
                                  }
                                }
                                h2 {
                                  font-weight: 600;
                                  font-size: 2rem;
                                  padding-bottom: 1rem;
                                }
                                p {
                                  font-size: 1rem;
                                  line-height: 1.3rem;
                                  padding: 0.5rem 0;
                                  a {
                                    &:visited {
                                      color: rgb(var(--vs-primary));
                                    }
                                  }
                                }
                                }

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

                                </style>



                                <?php if($dns['exists'] && $dns['is_whmcs']): ?>
                                <style>
                                    /* Dialog Base Styles */
                                    dialog.dns-dialog {
                                        padding: 0;
                                        border: none;
                                        border-radius: 0.75rem;
                                        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
                                        max-width: 1100px;
                                        width: 95%;
                                        max-height: 90vh;
                                        overflow: hidden;
                                    }
                                    dialog.dns-dialog::backdrop {
                                        background: rgba(0, 0, 0, 0.5);
                                        backdrop-filter: blur(4px);
                                    }
                                    dialog.dns-dialog[open] {
                                        animation: dialogFadeIn 0.2s ease-out;
                                    }
                                    @keyframes dialogFadeIn {
                                        from { opacity: 0; transform: scale(0.95); }
                                        to { opacity: 1; transform: scale(1); }
                                    }

                                    /* Custom Scrollbar */
                                    .dns-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
                                    .dns-scrollbar::-webkit-scrollbar-track { background: transparent; }
                                    .dns-scrollbar::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
                                    .dns-scrollbar::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
                                    .dark .dns-scrollbar::-webkit-scrollbar-thumb { background: #4b5563; }

                                    /* Badge Styles */
                                    .dns-type-badge {
                                        display: inline-flex;
                                        align-items: center;
                                        justify-content: center;
                                        min-width: 55px;
                                        padding: 0.25rem 0.625rem;
                                        border-radius: 0.375rem;
                                        font-size: 0.75rem;
                                        font-weight: 600;
                                        letter-spacing: 0.025em;
                                    }
                                    .dns-type-A { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
                                    .dns-type-AAAA { background: rgba(99, 102, 241, 0.1); color: #4f46e5; }
                                    .dns-type-CNAME { background: rgba(168, 85, 247, 0.1); color: #9333ea; }
                                    .dns-type-MX { background: rgba(249, 115, 22, 0.1); color: #ea580c; }
                                    .dns-type-TXT { background: rgba(107, 114, 128, 0.1); color: #4b5563; }
                                    .dns-type-NS { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
                                    .dns-type-SRV { background: rgba(236, 72, 153, 0.1); color: #db2777; }
                                    .dns-type-SOA { background: rgba(245, 158, 11, 0.1); color: #d97706; }
                                    .dns-type-CAA { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
                                    .dns-type-PTR { background: rgba(6, 182, 212, 0.1); color: #0891b2; }

                                    .dark .dns-type-A { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
                                    .dark .dns-type-AAAA { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
                                    .dark .dns-type-CNAME { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
                                    .dark .dns-type-MX { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
                                    .dark .dns-type-TXT { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
                                    .dark .dns-type-NS { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
                                    .dark .dns-type-SRV { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
                                    .dark .dns-type-SOA { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
                                    .dark .dns-type-CAA { background: rgba(239, 68, 68, 0.2); color: #f87171; }
                                    .dark .dns-type-PTR { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }

                                    /* Table Row Hover */
                                    .dns-table-row { transition: background-color 0.15s ease; }
                                    .dns-table-row:hover { background-color: rgba(59, 130, 246, 0.04); }
                                    .dark .dns-table-row:hover { background-color: rgba(59, 130, 246, 0.08); }
                                </style>

                                <!-- Main DNS Dialog -->
                                <dialog id="dnsDialog" class="dns-dialog bg-white dark:bg-gray-900 ring-1 ring-gray-950/5 dark:ring-white/10">
                                    <div class="flex flex-col h-full max-h-[90vh]">
                                        <header class="flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-white/10 bg-gray-50/50 dark:bg-gray-800/50">
                                            <div class="flex items-center gap-4">
                                                <div class="flex items-center justify-center w-10 h-10 rounded-lg bg-primary-100 dark:bg-primary-500/20">
                                                    <svg class="w-5 h-5 text-primary-600 dark:text-primary-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" />
                                                    </svg>
                                                </div>
                                                <span class="text-xl font-semibold text-success-700 dark:text-success-400">DNS Yönetimi</span>

                                            </div>
                                            <div class="flex items-center gap-3">
                                                <button onclick="window.dnsDialog.close()" class="p-2 rounded-lg text-gray-400 hover:text-gray-500 hover:bg-gray-100 dark:hover:bg-gray-800 transition duration-75">
                                                    <svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
                                                    </svg>
                                                </button>
                                            </div>
                                        </header>

                                        <!-- Body -->
                                        <div class="flex-1 overflow-y-auto dns-scrollbar p-6 space-y-6">

                                            <!-- Toolbar -->
                                            <div class="flex flex-col sm:flex-row gap-4 items-stretch sm:items-center justify-between">
                                                <!-- Search -->
                                                <div class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 ring-gray-950/10 dark:ring-white/20 focus-within:ring-2 focus-within:ring-primary-600 dark:focus-within:ring-primary-500 w-full sm:max-w-sm">
                                                    <div class="flex items-center ps-3 pointer-events-none">
                                                        <svg class="w-5 h-5 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
                                                            <path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd" />
                                                        </svg>
                                                    </div>
                                                    <input
                                                        type="text"
                                                        id="dnsSearchInput"
                                                        class="fi-input block w-full border-none py-2 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 dark:text-white dark:placeholder:text-gray-500 sm:text-sm sm:leading-6 bg-white/0 ps-2 pe-3"
                                                        placeholder="Kayıt ara..."
                                                    >
                                                </div>

                                                <!-- Add Button -->
                                                <button
                                                    onclick="openDnsRecordDialog()"
                                                    style="--c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);"
                                                    class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500 dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50"
                                                >
                                                    <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path>
                                                    </svg>
                                                    <span class="fi-btn-label">Kayıt Ekle</span>
                                                </button>
                                            </div>

                                            <!-- Records Table -->
                                            <div class="rounded-xl ring-1 ring-gray-950/5 dark:ring-white/10 overflow-hidden">
                                                <div class="overflow-x-auto">
                                                    <table class="w-full text-start">
                                                        <thead>
                                                            <tr class="bg-gray-50 dark:bg-white/5">
                                                                <th class="px-4 py-3 text-start text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider cursor-pointer hover:text-gray-700 dark:hover:text-gray-200" onclick="dnsSortTable('type')">Tür</th>
                                                                <th class="px-4 py-3 text-start text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider cursor-pointer hover:text-gray-700 dark:hover:text-gray-200" onclick="dnsSortTable('name')">Ad</th>
                                                                <th class="px-4 py-3 text-start text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider cursor-pointer hover:text-gray-700 dark:hover:text-gray-200" onclick="dnsSortTable('content')">İçerik</th>
                                                                <th class="px-4 py-3 text-start text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider cursor-pointer hover:text-gray-700 dark:hover:text-gray-200" onclick="dnsSortTable('ttl')">TTL</th>
                                                                <th class="px-4 py-3 text-end text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">İşlemler</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody id="dnsRecordsTableBody" class="divide-y divide-gray-100 dark:divide-white/5">
                                                            <!-- Filled by JS -->
                                                        </tbody>
                                                    </table>
                                                </div>

                                                <!-- Table Footer -->
                                                <div class="px-4 py-3 bg-gray-50/50 dark:bg-white/2.5 border-t border-gray-100 dark:border-white/5 flex items-center justify-between">
                                                    <span id="dnsRecordCount" class="text-xs text-gray-500 dark:text-gray-400">Toplam 0 kayıt</span>
                                                    <button onclick="refreshDnsPage()" class="text-xs font-medium text-primary-600 dark:text-primary-400 hover:text-primary-500 flex items-center gap-1.5 transition duration-75">
                                                        <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
                                                        </svg>
                                                        Yenile
                                                    </button>
                                                </div>
                                            </div>
                                        </div>

                                        <!-- Footer -->
                                        <footer class="px-6 py-4 border-t border-gray-200 dark:border-white/10 bg-gray-50/50 dark:bg-gray-800/50 flex justify-end">
                                            <button
                                                onclick="window.dnsDialog.close()"
                                                class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-white text-gray-950 hover:bg-gray-50 dark:bg-white/5 dark:text-white dark:hover:bg-white/10 ring-1 ring-gray-950/10 dark:ring-white/20"
                                            >
                                                <span class="fi-btn-label">Kapat</span>
                                            </button>
                                        </footer>
                                    </div>
                                </dialog>

                                <!-- Add/Edit Record Dialog -->
                                <dialog id="dnsRecordDialog" style="max-width: 400px;" class="dns-dialog bg-white dark:bg-gray-900 ring-1 ring-gray-950/5 dark:ring-white/10 sm:max-w-lg">
                                    <div class="fi-simple-page">
                                        <section class="grid auto-cols-fr gap-y-6 px-6 py-8 sm:px-12">
                                            <!-- Header -->
                                            <header class="fi-simple-header flex flex-col items-center">
                                                <div id="dnsRecordDialogIcon" class="flex items-center justify-center w-12 h-12 rounded-xl bg-primary-100 dark:bg-primary-500/20 mb-4">
                                                    <svg class="w-6 h-6 text-primary-600 dark:text-primary-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path>
                                                    </svg>
                                                </div>
                                                <h1 id="dnsRecordDialogTitle" class="fi-simple-header-heading text-center text-2xl font-bold tracking-tight text-gray-950 dark:text-white">
                                                    DNS Kaydı Ekle
                                                </h1>
                                                <p id="dnsRecordDialogDesc" class="mt-2 text-center text-sm text-gray-500 dark:text-gray-400"><?php echo e($dns['domain']); ?> için yeni kayıt oluşturun</p>
                                            </header>

                                            <!-- Form -->
                                            <form id="dnsRecordForm" onsubmit="saveDnsRecord(event)" class="fi-form grid gap-y-5">
                                                <input type="hidden" id="dnsEditMode" value="add">
                                                <input type="hidden" id="dnsEditIndex" value="-1">
                                                <input type="hidden" id="dnsOriginalName" value="">
                                                <input type="hidden" id="dnsOriginalType" value="">

                                                <!-- Type & TTL -->
                                                <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">
                                                    <div class="fi-fo-field-wrp">
                                                        <div class="grid gap-y-2">
                                                            <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                                <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">Kayıt Tipi</span>
                                                            </label>
                                                            <select id="dnsRecordType" onchange="updateDnsFormFields()" class="fi-input block w-full border-none py-2 text-base text-gray-950 transition duration-75 focus:ring-0 dark:text-white sm:text-sm sm:leading-6 bg-white dark:bg-white/5 rounded-lg ring-1 ring-gray-950/10 dark:ring-white/20 focus:ring-2 focus:ring-primary-600 dark:focus:ring-primary-500 px-3">
                                                                <option value="A">A</option>
                                                                <option value="AAAA">AAAA</option>
                                                                <option value="CNAME">CNAME</option>
                                                                <option value="MX">MX</option>
                                                                <option value="TXT">TXT</option>
                                                                <option value="NS">NS</option>
                                                                <option value="SRV">SRV</option>
                                                                <option value="CAA">CAA</option>
                                                                <option value="PTR">PTR</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <div class="fi-fo-field-wrp">
                                                        <div class="grid gap-y-2">
                                                            <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                                <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">TTL</span>
                                                            </label>
                                                            <select id="dnsRecordTTL" class="fi-input block w-full border-none py-2 text-base text-gray-950 transition duration-75 focus:ring-0 dark:text-white sm:text-sm sm:leading-6 bg-white dark:bg-white/5 rounded-lg ring-1 ring-gray-950/10 dark:ring-white/20 focus:ring-2 focus:ring-primary-600 dark:focus:ring-primary-500 px-3">
                                                                <option value="300">5 dakika</option>
                                                                <option value="3600" selected>1 saat</option>
                                                                <option value="14400">4 saat</option>
                                                                <option value="86400">1 gün</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>

                                                <!-- Name/Host -->
                                                <div class="fi-fo-field-wrp">
                                                    <div class="grid gap-y-2">
                                                        <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3">
                                                            <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
                                                                Ad (Host)
                                                            </span>
                                                        </label>
                                                        <div class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 focus-within:ring-2 ring-gray-950/10 dark:ring-white/20 focus-within:ring-primary-600 dark:focus-within:ring-primary-500 overflow-hidden">
                                                            <input
                                                                type="text"
                                                                id="dnsRecordName"
                                                                class="fi-input block w-full border-none py-2 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 dark:text-white dark:placeholder:text-gray-500 sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3"
                                                                placeholder="@ veya www"
                                                            />
                                                            <span class="inline-flex items-center px-3 py-2 border-s border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-white/5 text-gray-500 dark:text-gray-400 text-sm select-none">.<?php echo e($dns['domain']); ?></span>
                                                        </div>
                                                        <p class="text-xs text-gray-500 dark:text-gray-400">Root domain için @ veya boş bırakın</p>
                                                    </div>
                                                </div>

                                                <!-- Dynamic Fields -->
                                                <div id="dnsDynamicFields" class="grid gap-y-2">
                                                    <!-- Fields injected by JS -->
                                                </div>

                                                <!-- Buttons -->
                                                <div class="fi-form-actions pt-2">
                                                    <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;">
                                                        <button
                                                            type="button"
                                                            onclick="window.dnsRecordDialog.close()"
                                                            class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-white text-gray-950 hover:bg-gray-50 dark:bg-white/5 dark:text-white dark:hover:bg-white/10 ring-1 ring-gray-950/10 dark:ring-white/20"
                                                        >
                                                            <span class="fi-btn-label">İptal</span>
                                                        </button>
                                                        <button
                                                            type="submit"
                                                            id="dnsSubmitBtn"
                                                            style="--c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);"
                                                            class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500 dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50"
                                                        >
                                                            <span class="fi-btn-label">Kaydet</span>
                                                        </button>
                                                    </div>
                                                </div>

                                                <!-- Response Messages -->
                                                <div id="dnsResponseMessage"></div>
                                            </form>
                                        </section>
                                    </div>
                                </dialog>

                                <script>
                                (function() {
                                    'use strict';

                                    const dnsZoneId = '<?php echo e($dns["domain"]); ?>';
                                    const dnsZoneDomain = '<?php echo e($dns["domain"]); ?>';
                                    const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '<?php echo e(csrf_token()); ?>';

                                    // Store dialog references
                                    window.dnsDialog = document.getElementById('dnsDialog');
                                    window.dnsRecordDialog = document.getElementById('dnsRecordDialog');

                                    // Parse records from PHP
                                    let dnsRecords = [];
                                    <?php if(isset($dns['zone']['rrsets'])): ?>
                                        <?php $__currentLoopData = $dns['zone']['rrsets']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rrset): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php $__currentLoopData = $rrset['records'] ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $record): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                dnsRecords.push({
                                                    name: '<?php echo e(rtrim($rrset["name"] ?? "", ".")); ?>',
                                                    type: '<?php echo e($rrset["type"] ?? ""); ?>',
                                                    ttl: <?php echo e($rrset["ttl"] ?? 3600); ?>,
                                                    content: <?php echo json_encode($record["content"] ?? "", JSON_UNESCAPED_UNICODE); ?>,
                                                    disabled: <?php echo e(($record["disabled"] ?? false) ? 'true' : 'false'); ?>

                                                });
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php endif; ?>

                                    let dnsCurrentSort = { field: null, direction: 'asc' };

                                    // Field definitions
                                    const dnsFieldDefs = {
                                        'A': [{ id: 'address', label: 'IPv4 Adresi', placeholder: '192.168.1.1', type: 'text' }],
                                        'AAAA': [{ id: 'address', label: 'IPv6 Adresi', placeholder: '2001:db8::1', type: 'text' }],
                                        'CNAME': [{ id: 'cname', label: 'Hedef', placeholder: 'target.example.com', type: 'text' }],
                                        'MX': [
                                            { id: 'preference', label: 'Öncelik', placeholder: '10', type: 'number' },
                                            { id: 'exchange', label: 'Mail Sunucu', placeholder: 'mail.example.com', type: 'text' }
                                        ],
                                        'TXT': [{ id: 'txtdata', label: 'Metin', placeholder: 'v=spf1 include:_spf.google.com ~all', type: 'textarea' }],
                                        'NS': [{ id: 'nsdname', label: 'Nameserver', placeholder: 'ns1.example.com', type: 'text' }],
                                        'SRV': [
                                            { id: 'priority', label: 'Öncelik', placeholder: '0', type: 'number' },
                                            { id: 'weight', label: 'Ağırlık', placeholder: '5', type: 'number' },
                                            { id: 'port', label: 'Port', placeholder: '5060', type: 'number' },
                                            { id: 'target', label: 'Hedef', placeholder: 'sip.example.com', type: 'text' }
                                        ],
                                        'CAA': [
                                            { id: 'flag', label: 'Bayrak', placeholder: '0', type: 'number' },
                                            { id: 'tag', label: 'Etiket', placeholder: 'issue', type: 'text' },
                                            { id: 'value', label: 'Değer', placeholder: 'letsencrypt.org', type: 'text' }
                                        ],
                                        'PTR': [{ id: 'ptrdname', label: 'Hedef', placeholder: 'host.example.com', type: 'text' }]
                                    };

                                    // Normalize name
                                    function normalizeDnsName(name) {
                                        name = (name ?? '').trim().replace(/\.+$/, '');
                                        if (!name || name === '@') return '@';
                                        if (name.toLowerCase() === dnsZoneDomain.toLowerCase()) return '@';
                                        const re = new RegExp('(\\.)?' + dnsZoneDomain.replace(/\./g, '\\.') + '$', 'i');
                                        return name.replace(re, '') || '@';
                                    }

                                    // Open record dialog for ADD
                                    window.openDnsRecordDialog = function() {
                                        document.getElementById('dnsRecordForm').reset();
                                        document.getElementById('dnsEditMode').value = 'add';
                                        document.getElementById('dnsEditIndex').value = '-1';
                                        document.getElementById('dnsOriginalName').value = '';
                                        document.getElementById('dnsOriginalType').value = '';
                                        document.getElementById('dnsRecordDialogTitle').textContent = 'DNS Kaydı Ekle';
                                        document.getElementById('dnsRecordDialogDesc').textContent = dnsZoneDomain + ' için yeni kayıt oluşturun';
                                        document.getElementById('dnsRecordDialogIcon').innerHTML = '<svg class="w-6 h-6 text-primary-600 dark:text-primary-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path></svg>';
                                        document.getElementById('dnsSubmitBtn').querySelector('.fi-btn-label').textContent = 'Kaydet';
                                        document.getElementById('dnsRecordType').value = 'A';
                                        document.getElementById('dnsRecordType').disabled = false;
                                        document.getElementById('dnsResponseMessage').innerHTML = '';
                                        updateDnsFormFields();
                                        window.dnsRecordDialog.showModal();
                                    };

                                    // Open record dialog for EDIT
                                    window.editDnsRecord = function(index) {
                                        const record = dnsRecords[index];
                                        if (!record) return;

                                        document.getElementById('dnsRecordForm').reset();
                                        document.getElementById('dnsEditMode').value = 'edit';
                                        document.getElementById('dnsEditIndex').value = index;
                                        document.getElementById('dnsOriginalName').value = record.name.endsWith('.') ? record.name : record.name + '.';
                                        document.getElementById('dnsOriginalType').value = record.type;
                                        document.getElementById('dnsRecordDialogTitle').textContent = 'DNS Kaydı Düzenle';
                                        document.getElementById('dnsRecordDialogDesc').textContent = record.name + ' kaydını düzenliyorsunuz';
                                        document.getElementById('dnsRecordDialogIcon').innerHTML = '<svg class="w-6 h-6 text-warning-600 dark:text-warning-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" /></svg>';
                                        document.getElementById('dnsSubmitBtn').querySelector('.fi-btn-label').textContent = 'Güncelle';
                                        document.getElementById('dnsResponseMessage').innerHTML = '';

                                        // Set type (disabled during edit)
                                        document.getElementById('dnsRecordType').value = record.type;
                                        document.getElementById('dnsRecordType').disabled = true;

                                        // Set TTL
                                        document.getElementById('dnsRecordTTL').value = record.ttl;

                                        // Set name
                                        const displayName = normalizeDnsName(record.name);
                                        document.getElementById('dnsRecordName').value = displayName === '@' ? '' : displayName;

                                        // Update form fields first
                                        updateDnsFormFields();

                                        // Then populate content (with small delay to ensure fields exist)
                                        setTimeout(() => populateDnsFields(record.type, record.content), 50);

                                        window.dnsRecordDialog.showModal();
                                    };

                                    // Populate fields from content
                                    function populateDnsFields(type, content) {
                                        content = (content || '').trim();

                                        // Remove surrounding quotes from TXT
                                        if (type === 'TXT' && content.startsWith('"') && content.endsWith('"')) {
                                            content = content.slice(1, -1);
                                        }

                                        switch(type) {
                                            case 'A':
                                            case 'AAAA':
                                                setDnsField('address', content);
                                                break;
                                            case 'CNAME':
                                                setDnsField('cname', content);
                                                break;
                                            case 'NS':
                                                setDnsField('nsdname', content);
                                                break;
                                            case 'PTR':
                                                setDnsField('ptrdname', content);
                                                break;
                                            case 'TXT':
                                                setDnsField('txtdata', content);
                                                break;
                                            case 'MX':
                                                const mxParts = content.split(/\s+/);
                                                setDnsField('preference', mxParts[0] || '10');
                                                setDnsField('exchange', mxParts.slice(1).join(' '));
                                                break;
                                            case 'SRV':
                                                const srvParts = content.split(/\s+/);
                                                setDnsField('priority', srvParts[0] || '0');
                                                setDnsField('weight', srvParts[1] || '0');
                                                setDnsField('port', srvParts[2] || '0');
                                                setDnsField('target', srvParts.slice(3).join(' '));
                                                break;
                                            case 'CAA':
                                                const caaParts = content.split(/\s+/);
                                                setDnsField('flag', caaParts[0] || '0');
                                                setDnsField('tag', caaParts[1] || 'issue');
                                                let caaValue = caaParts.slice(2).join(' ');
                                                if (caaValue.startsWith('"') && caaValue.endsWith('"')) {
                                                    caaValue = caaValue.slice(1, -1);
                                                }
                                                setDnsField('value', caaValue);
                                                break;
                                        }
                                    }

                                    function setDnsField(id, value) {
                                        const el = document.getElementById('dnsField_' + id);
                                        if (el) el.value = value || '';
                                    }

                                    // Update form fields
                                    window.updateDnsFormFields = function() {
                                        const type = document.getElementById('dnsRecordType').value;
                                        const container = document.getElementById('dnsDynamicFields');
                                        const fields = dnsFieldDefs[type] || [];

                                        const inputStyle = 'display: block; width: 100%; border: none; padding: 0.5rem 0.75rem; font-size: 0.875rem; line-height: 1.5rem; background: rgba(255,255,255,0.05); border-radius: 0.5rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); color: inherit;';
                                        const labelStyle = 'font-size: 0.875rem; font-weight: 500; line-height: 1.5rem;';

                                        let html = '';

                                        if (fields.length === 1 && fields[0].type === 'textarea') {
                                            html = `<div>
                                                <div style="display: grid; gap: 0.5rem;">
                                                    <label style="${labelStyle}">${fields[0].label}</label>
                                                    <textarea id="dnsField_${fields[0].id}" rows="3" placeholder="${fields[0].placeholder}" style="${inputStyle} min-height: 80px;"></textarea>
                                                </div>
                                            </div>`;
                                        } else if (fields.length === 1) {
                                            html = `<div>
                                                <div style="display: grid; gap: 0.5rem;">
                                                    <label style="${labelStyle}">${fields[0].label} <sup style="color: #ef4444;">*</sup></label>
                                                    <input type="${fields[0].type}" id="dnsField_${fields[0].id}" placeholder="${fields[0].placeholder}" required style="${inputStyle}">
                                                </div>
                                            </div>`;
                                        } else if (fields.length === 2) {
                                            html = '<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">';
                                            fields.forEach(f => {
                                                html += `<div>
                                                    <div style="display: grid; gap: 0.5rem;">
                                                        <label style="${labelStyle}">${f.label}</label>
                                                        <input type="${f.type}" id="dnsField_${f.id}" placeholder="${f.placeholder}" style="${inputStyle}">
                                                    </div>
                                                </div>`;
                                            });
                                            html += '</div>';
                                        } else if (fields.length > 2) {
                                            html = '<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">';
                                            fields.forEach((f, i) => {
                                                const isLast = i === fields.length - 1;
                                                const isOdd = fields.length % 2 === 1;
                                                const fullWidth = isLast && isOdd;
                                                html += `<div style="${fullWidth ? 'grid-column: span 2;' : ''}">
                                                    <div style="display: grid; gap: 0.5rem;">
                                                        <label style="${labelStyle}">${f.label}</label>
                                                        <input type="${f.type}" id="dnsField_${f.id}" placeholder="${f.placeholder}" style="${inputStyle}">
                                                    </div>
                                                </div>`;
                                            });
                                            html += '</div>';
                                        }

                                        container.innerHTML = html;
                                    };

                                    // Render records
                                    window.dnsRenderRecords = function(data) {
                                        data = data || dnsRecords;
                                        const tbody = document.getElementById('dnsRecordsTableBody');

                                        if (!data || data.length === 0) {
                                            tbody.innerHTML = `<tr><td colspan="5" class="px-6 py-12 text-center">
                                                <div class="flex flex-col items-center gap-2 text-gray-400 dark:text-gray-500">
                                                    <svg class="w-10 h-10" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1" d="M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
                                                    <span class="text-sm font-medium">DNS kaydı bulunamadı</span>
                                                </div>
                                            </td></tr>`;
                                            document.getElementById('dnsRecordCount').textContent = 'Toplam 0 kayıt';
                                            return;
                                        }

                                        let html = '';
                                        data.forEach((r, i) => {
                                            const displayName = normalizeDnsName(r.name);
                                            const isProtected = ['SOA'].includes(r.type);
                                            const originalIndex = dnsRecords.indexOf(r);

                                            html += `<tr class="dns-table-row">
                                                <td class="px-4 py-3 whitespace-nowrap"><span class="dns-type-badge dns-type-${r.type}">${r.type}</span></td>
                                                <td class="px-4 py-3 whitespace-nowrap text-sm font-medium text-gray-950 dark:text-white">${displayName}${displayName !== '@' ? `<span class="text-gray-400 dark:text-gray-500 text-xs ml-1">.${dnsZoneDomain}</span>` : ''}</td>
                                                <td class="px-4 py-3 text-sm text-gray-600 dark:text-gray-300 font-mono max-w-xs truncate" title="${String(r.content).replace(/"/g, '&quot;')}">${r.content}</td>
                                                <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">${r.ttl}</td>
                                                <td class="px-4 py-3 whitespace-nowrap text-end">
                                                    <div class="flex items-center justify-end gap-1">
                                                        ${!isProtected ? `
                                                            <button onclick="editDnsRecord(${originalIndex})" class="p-1.5 rounded-lg text-warning-600 hover:text-warning-500 hover:bg-warning-50 dark:text-warning-400 dark:hover:bg-warning-500/10 transition duration-75" title="Düzenle">
                                                                <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" /></svg>
                                                            </button>
                                                            <button onclick="deleteDnsRecord(${originalIndex})" class="p-1.5 rounded-lg text-danger-600 hover:text-danger-500 hover:bg-danger-50 dark:text-danger-400 dark:hover:bg-danger-500/10 transition duration-75" title="Sil">
                                                                <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg>
                                                            </button>
                                                        ` : '<span class="text-xs text-gray-400 dark:text-gray-500">Korumalı</span>'}
                                                    </div>
                                                </td>
                                            </tr>`;
                                        });

                                        tbody.innerHTML = html;
                                        document.getElementById('dnsRecordCount').textContent = `Toplam ${data.length} kayıt`;
                                    };

                                    // Sort table
                                    window.dnsSortTable = function(field) {
                                        if (dnsCurrentSort.field === field) {
                                            dnsCurrentSort.direction = dnsCurrentSort.direction === 'asc' ? 'desc' : 'asc';
                                        } else {
                                            dnsCurrentSort.field = field;
                                            dnsCurrentSort.direction = 'asc';
                                        }
                                        dnsRecords.sort((a, b) => {
                                            let aVal = field === 'ttl' ? parseInt(a[field]) || 0 : String(a[field]).toLowerCase();
                                            let bVal = field === 'ttl' ? parseInt(b[field]) || 0 : String(b[field]).toLowerCase();
                                            return dnsCurrentSort.direction === 'asc' ? (aVal < bVal ? -1 : 1) : (aVal > bVal ? -1 : 1);
                                        });
                                        dnsRenderRecords();
                                    };

                                    // Save record (Add or Edit)
                                    window.saveDnsRecord = function(e) {
                                        e.preventDefault();

                                        const editMode = document.getElementById('dnsEditMode').value;
                                        const editIndex = parseInt(document.getElementById('dnsEditIndex').value);
                                        const type = document.getElementById('dnsRecordType').value;
                                        const nameRaw = document.getElementById('dnsRecordName').value.trim();
                                        const ttl = parseInt(document.getElementById('dnsRecordTTL').value) || 3600;

                                        let name = (!nameRaw || nameRaw === '@') ? dnsZoneDomain : nameRaw + '.' + dnsZoneDomain;
                                        let content = '';

                                        switch(type) {
                                            case 'A': case 'AAAA': content = document.getElementById('dnsField_address')?.value || ''; break;
                                            case 'CNAME': content = document.getElementById('dnsField_cname')?.value || ''; break;
                                            case 'NS': content = document.getElementById('dnsField_nsdname')?.value || ''; break;
                                            case 'PTR': content = document.getElementById('dnsField_ptrdname')?.value || ''; break;
                                            case 'TXT':
                                                let txt = document.getElementById('dnsField_txtdata')?.value || '';
                                                content = txt.startsWith('"') ? txt : '"' + txt + '"';
                                                break;
                                            case 'MX':
                                                content = (document.getElementById('dnsField_preference')?.value || '10') + ' ' + (document.getElementById('dnsField_exchange')?.value || '');
                                                break;
                                            case 'SRV':
                                                content = [
                                                    document.getElementById('dnsField_priority')?.value || '0',
                                                    document.getElementById('dnsField_weight')?.value || '0',
                                                    document.getElementById('dnsField_port')?.value || '0',
                                                    document.getElementById('dnsField_target')?.value || ''
                                                ].join(' ');
                                                break;
                                            case 'CAA':
                                                content = (document.getElementById('dnsField_flag')?.value || '0') + ' ' +
                                                         (document.getElementById('dnsField_tag')?.value || 'issue') + ' "' +
                                                         (document.getElementById('dnsField_value')?.value || '') + '"';
                                                break;
                                        }

                                        if (!content.trim() || content === '""') {
                                            showDnsMessage('Lütfen gerekli alanları doldurun', 'error');
                                            return;
                                        }

                                        const newRecord = { name, type, content, ttl, disabled: false };

                                        // For edit mode, we need to delete old record first and add new one
                                        if (editMode === 'edit') {
                                            const originalName = document.getElementById('dnsOriginalName').value;
                                            const originalType = document.getElementById('dnsOriginalType').value;

                                            // Delete old record
                                            fetch('/api/powerdns/zones/' + dnsZoneId + '/records', {
                                                method: 'DELETE',
                                                headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken, 'Accept': 'application/json' },
                                                body: JSON.stringify({ name: originalName, type: originalType })
                                            })
                                            .then(res => res.json())
                                            .then(result => {
                                                // Now add new record
                                                return fetch('/api/powerdns/zones/' + dnsZoneId + '/records', {
                                                    method: 'POST',
                                                    headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken, 'Accept': 'application/json' },
                                                    body: JSON.stringify({ name, type, content, ttl })
                                                });
                                            })
                                            .then(res => res.json())
                                            .then(result => {
                                                if (result.success) {
                                                    // Update local records array
                                                    if (editIndex >= 0 && editIndex < dnsRecords.length) {
                                                        dnsRecords[editIndex] = newRecord;
                                                    }
                                                    dnsRenderRecords();
                                                    window.dnsRecordDialog.close();
                                                    showDnsToast('Kayıt başarıyla güncellendi', 'success');
                                                } else {
                                                    showDnsMessage('Hata: ' + (result.message || 'İşlem başarısız'), 'error');
                                                }
                                            })
                                            .catch(err => showDnsMessage('Hata: ' + err.message, 'error'));
                                        } else {
                                            // Add new record
                                            fetch('/api/powerdns/zones/' + dnsZoneId + '/records', {
                                                method: 'POST',
                                                headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken, 'Accept': 'application/json' },
                                                body: JSON.stringify({ name, type, content, ttl })
                                            })
                                            .then(res => res.json())
                                            .then(result => {
                                                if (result.success) {
                                                    // Add to local records array
                                                    dnsRecords.push(newRecord);
                                                    dnsRenderRecords();
                                                    window.dnsRecordDialog.close();
                                                    showDnsToast('Kayıt başarıyla eklendi', 'success');
                                                } else {
                                                    showDnsMessage('Hata: ' + (result.message || 'İşlem başarısız'), 'error');
                                                }
                                            })
                                            .catch(err => showDnsMessage('Hata: ' + err.message, 'error'));
                                        }
                                    };

                                    // Delete record
                                    window.deleteDnsRecord = function(index) {
                                        const r = dnsRecords[index];
                                        if (!r || !confirm(`"${r.name}" (${r.type}) kaydını silmek istediğinize emin misiniz?`)) return;

                                        fetch('/api/powerdns/zones/' + dnsZoneId + '/records', {
                                            method: 'DELETE',
                                            headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken, 'Accept': 'application/json' },
                                            body: JSON.stringify({ name: r.name.endsWith('.') ? r.name : r.name + '.', type: r.type })
                                        })
                                        .then(res => res.json())
                                        .then(result => {
                                            if (result.success) {
                                                dnsRecords.splice(index, 1);
                                                dnsRenderRecords();
                                                showDnsToast('Kayıt silindi', 'success');
                                            } else {
                                                showDnsToast('Hata: ' + (result.message || 'Silinemedi'), 'error');
                                            }
                                        })
                                        .catch(err => showDnsToast('Hata: ' + err.message, 'error'));
                                    };

                                    // Refresh
                                    window.refreshDnsPage = function() { location.reload(); };

                                    // Search
                                    document.getElementById('dnsSearchInput')?.addEventListener('input', function(e) {
                                        const term = e.target.value.toLowerCase();
                                        dnsRenderRecords(term ? dnsRecords.filter(r =>
                                            String(r.name).toLowerCase().includes(term) ||
                                            String(r.content).toLowerCase().includes(term) ||
                                            String(r.type).toLowerCase().includes(term)
                                        ) : dnsRecords);
                                    });

                                    // Message helpers
                                    function showDnsMessage(msg, type) {
                                        const color = type === 'success' ? 'green' : 'yellow';
                                        document.getElementById('dnsResponseMessage').innerHTML = `
                                            <div class="flex items-center p-4 text-sm text-${color}-800 rounded-lg bg-${color}-50 dark:bg-gray-800 dark:text-${color}-400">
                                                <svg class="w-4 h-4 me-3" fill="currentColor" viewBox="0 0 20 20"><path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/></svg>
                                                <span class="font-medium">${type === 'success' ? 'Başarılı!' : 'Hata!'}</span> ${msg}
                                            </div>`;
                                    }

                                    function showDnsToast(msg, type) {
                                        const div = document.createElement('div');
                                        div.className = `fixed bottom-5 right-5 ${type === 'success' ? 'bg-success-600' : 'bg-danger-600'} text-white px-5 py-3 rounded-lg shadow-lg z-[100] text-sm font-medium flex items-center gap-2`;
                                        div.innerHTML = `<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="${type === 'success' ? 'M5 13l4 4L19 7' : 'M6 18L18 6M6 6l12 12'}"/></svg>${msg}`;
                                        document.body.appendChild(div);
                                        setTimeout(() => div.remove(), 3000);
                                    }

                                    // ESC key
                                    document.addEventListener('keydown', e => {
                                        if (e.key === 'Escape') {
                                            if (window.dnsRecordDialog.open) window.dnsRecordDialog.close();
                                            else if (window.dnsDialog.open) window.dnsDialog.close();
                                        }
                                    });

                                    // Init
                                    dnsRenderRecords();
                                    updateDnsFormFields();
                                })();
                                </script>
                                <?php endif; ?>

                                <dialog id="dialog" class="fi-simple-main  w-full bg-white px-6 py-12 shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10 sm:rounded-xl sm:px-12 sm:max-w-lg">
                                    <div class="fi-simple-page">
                                        <section class="grid auto-cols-fr gap-y-6">
                                            <header class="fi-simple-header flex flex-col items-center">
                                                <img alt="filament-panels::layout.logo.alt" src="https://sspanel.serversistemleri.com/templates/sspanel/design/images/media/logos/logo-big-white.png" class="fi-logo flex mb-4" />
                                                <h1 class="fi-simple-header-heading text-center text-2xl font-bold tracking-tight text-gray-950 dark:text-white">
                                                    Doğrulama Kodu
                                                </h1>
                                                <p style="text-align: center;">Transfer kodunuzun güvenli bir şekilde gönderilebilmesi için lütfen SMS doğrulama kodunuzu giriniz!</p>
                                            </header>

                                            <form action="<?php echo e(route('domain.save')); ?>" method="post" class="verify-form fi-form grid gap-y-6">
                                                <?php echo csrf_field(); ?>
                                                <input type="hidden" name="action" value="verify">
                                                <input type="hidden" name="domainid" value="<?php echo e($product['domainid']); ?>">
                                                <div style="--cols-default: repeat(1, minmax(0, 1fr));" class="grid grid-cols-[--cols-default] fi-fo-component-ctn gap-6">
                                                    <div style="--col-span-default: span 1 / span 1;" class="col-[--col-span-default]">
                                                        <div data-field-wrapper="" class="fi-fo-field-wrp">
                                                            <div class="grid gap-y-2">
                                                                <div class="flex items-center gap-x-3 justify-between">
                                                                    <label class="fi-fo-field-wrp-label inline-flex items-center gap-x-3" for="data.email">
                                                                        <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
                                                                            Doğrulama Kodu
                                                                            <sup class="text-danger-600 dark:text-danger-400 font-medium">*</sup>
                                                                        </span>
                                                                    </label>
                                                                </div>
                                                                <div class="grid auto-cols-fr gap-y-2">
                                                                    <div
                                                                        class="fi-input-wrp flex rounded-lg shadow-sm ring-1 transition duration-75 bg-white dark:bg-white/5 focus-within:ring-2 ring-gray-950/10 dark:ring-white/20 focus-within:ring-primary-600 dark:focus-within:ring-primary-500 fi-fo-text-input overflow-hidden"
                                                                    >
                                                                        <div class="min-w-0 flex-1">
                                                                            <input
                                                                                class="fi-input block w-full border-none py-1.5 text-base text-gray-950 transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 dark:text-white dark:placeholder:text-gray-500 sm:text-sm sm:leading-6 bg-white/0 ps-3 pe-3"
                                                                                autocomplete="on"
                                                                                autofocus="autofocus"
                                                                                name="code"
                                                                                required="required"
                                                                                type="text"
                                                                            />
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="fi-form-actions">
                                                    <div class="fi-ac gap-3 grid grid-cols-[repeat(auto-fit,minmax(0,1fr))]">
                                                        <button
                                                            style="--c-400: var(--primary-400); --c-500: var(--primary-500); --c-600: var(--primary-600);"
                                                            class="fi-btn relative grid-flow-col items-center justify-center font-semibold outline-none transition duration-75 focus-visible:ring-2 rounded-lg fi-color-custom fi-btn-color-primary fi-color-primary fi-size-md fi-btn-size-md gap-1.5 px-3 py-2 text-sm inline-grid shadow-sm bg-custom-600 text-white hover:bg-custom-500 focus-visible:ring-custom-500/50 dark:bg-custom-500 dark:hover:bg-custom-400 dark:focus-visible:ring-custom-400/50 fi-ac-action fi-ac-btn-action"
                                                            type="submit"
                                                            id="submit-button"
                                                        >
                                                            <span class="fi-btn-label">Kodu Doğrula</span>
                                                        </button>
                                                    </div>
                                                </div>
                                                <div id="response-message">
                                                  <div id="verifystatus-message" style="display: none;">
                                                    <div class="flex items-center p-4 mb-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400" role="alert">
                                                      <svg style="margin-right: 10px;" class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
                                                        <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
                                                      </svg>
                                                      <span class="sr-only">Info</span>
                                                      <div>
                                                        <span class="font-medium">Başarılı! </span> <span id="verifystatus-message-text"></span>
                                                      </div>
                                                    </div>
                                                  </div>
                                                  <div id="verifyerror-message" style="display: none;">
                                                    <div class="flex items-center p-4 mb-4 text-sm text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300" role="alert">
                                                      <svg style="margin-right: 10px;" class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
                                                        <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
                                                      </svg>
                                                      <span class="sr-only">Info</span>
                                                      <div>
                                                        <span class="font-medium">Hata! </span> <span id="verifyerror-message-text"></span>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                            </form>

                                        </section>
                                    </div>

                                    <button onclick="window.dialog.close();" aria-label="close" class="x">❌</button>
                                </dialog>

            <?php endif; ?>
            <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
            <script>
            document.getElementById("nameserver-save-button").addEventListener("click", function () {
    var replyForm = document.getElementById("nameserver-save-form");
    if (replyForm.classList.contains("hidden")) {
        replyForm.classList.remove("hidden");
    } else {
        replyForm.classList.add("hidden");
      }
    });

    document.getElementById("addnameserver-button").addEventListener("click", function () {
      var replyForm = document.getElementById("addnameserver-form");
      if (replyForm.classList.contains("hidden")) {
          replyForm.classList.remove("hidden");
        } else {
          replyForm.classList.add("hidden");
        }
      });

      document.getElementById("updateaddnameserver-button").addEventListener("click", function () {
        var replyForm = document.getElementById("updateaddnameserver-form");
        if (replyForm.classList.contains("hidden")) {
          replyForm.classList.remove("hidden");
        } else {
          replyForm.classList.add("hidden");
        }
      });

      document.getElementById("deleteaddnameserver-button").addEventListener("click", function () {
        var replyForm = document.getElementById("deleteaddnameserver-form");
        if (replyForm.classList.contains("hidden")) {
          replyForm.classList.remove("hidden");
        } else {
          replyForm.classList.add("hidden");
        }
      });

      $(document).ready(function () {
        $(document).on("submit", "form.epp-form", function (e) {
          e.preventDefault();
          var form = $(this);
          var url = form.attr("action");
          var method = form.attr("method");
          var data = form.serialize();
          var button = form.find("button");
          var originalButtonText = button.text();

          $.ajax({
              url: url,
              method: method,
              data: data,
              success: function (response) {

                  },
                  error: function (xhr, status, error) {
                    $("#eppstatus-message").hide();
                    $("#epperror-message").hide();
                    $("#epperror-message-text").html("Bir hata oluştu. Lütfen tekrar deneyin.");
                    $("#epperror-message").show();
                  },
                });
              });
            });
            $(document).ready(function () {
              $(document).on("submit", "form.verify-form", function (e) {
                e.preventDefault();
                var form = $(this);
                var url = form.attr("action");
                var method = form.attr("method");
                var data = form.serialize();
                var button = form.find("button");
                var originalButtonText = button.text();

                // Buton ismini "Lütfen bekleyiniz.." olarak değiştir
                button.text("Lütfen bekleyiniz..");
                button.prop("disabled", true);
                $.ajax({
                  url: url,
                  method: method,
                  data: data,
                  success: function (response) {
                    $("#verifystatus-message").hide();
                    $("#verifyerror-message").hide();

                    if (response.status === "success") {
                      $("#verifystatus-message-text").html(response.message);
                      $("#verifystatus-message").show();
                      setTimeout(function () {
                          window.dialog.close();
                        }, 3000);
                      } else {
                        $("#verifyerror-message-text").html(response.message);
                        $("#verifyerror-message").show();
                      }

                      // Buton ismini geri değiştir
                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                    error: function (xhr, status, error) {
                      $("#verifystatus-message").hide();
                      $("#verifyerror-message").hide();
                      $("#verifyerror-message-text").html("Bir hata oluştu. Lütfen tekrar deneyin.");
                      $("#verifyerror-message").show();

                      // Buton ismini geri değiştir
                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                  });
                });
              });

              $(document).ready(function () {
                $(document).on("submit", "form.renew-form", function (e) {
                  e.preventDefault();
                  var form = $(this);
                  var url = form.attr("action");
                  var method = form.attr("method");
                  var data = form.serialize();
                  var button = form.find("button");
                  var originalButtonText = button.text();
                  var statusLabel = $("#renew-status-label");
                  // Buton ismini "Lütfen bekleyiniz.." olarak değiştir
                  button.text("Lütfen bekleyiniz..");
                  button.prop("disabled", true);
                  $.ajax({
                    url: url,
                    method: method,
                    data: data,
                    success: function (response) {
                      $("#eppstatus-message").hide();
                      $("#epperror-message").hide();

                      if (response.status === "success") {
                        $("#eppstatus-message-text").html(response.message);
                        $("#eppstatus-message").show();

                        // Orijinal buton metnine göre yeni metni ayarla
                        if (originalButtonText === "Aktif Et") {
                          button.text("Devre Dışı Bırak");
                          statusLabel.text("Aktif");
                          statusLabel.removeClass("label-danger bg-red-500").addClass("label-success bg-green-500");
                        }
                        if (originalButtonText === "Devre Dışı Bırak") {
                          button.text("Aktif Et");
                          statusLabel.text("Pasif");
                          statusLabel.removeClass("label-success bg-green-500").addClass("label-danger bg-red-500");
                        }
                      } else {
                        $("#lockederror-message-text").html(response.message);
                        $("#lockederror-message").show();
                        // Hata durumunda buton metnini geri yükle
                        button.text(originalButtonText);
                      }

                      // Buton ismini geri değiştir
                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                    error: function (xhr, status, error) {
                      $("#eppstatus-message").hide();
                      $("#epperror-message").hide();
                      $("#epperror-message-text").html("Bir hata oluştu. Lütfen tekrar deneyin.");
                      $("#epperror-message").show();

                      // Buton ismini geri değiştir
                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                  });
                });
              });
              $(document).ready(function () {
                var button = $("form.locked-form").find("button");
                var originalButtonText = button.text();
                var eppFormMb = $(".epp-form-mb");

                // Sayfa yüklendiğinde orijinal button text "Devre Dışı Bırak" ise .epp-form-mb öğesini gizle
                if (originalButtonText === "Devre Dışı Bırak") {
                  eppFormMb.hide();
                }

                $(document).on("submit", "form.locked-form", function (e) {
                  e.preventDefault();
                  var form = $(this);
                  var url = form.attr("action");
                  var method = form.attr("method");
                  var data = form.serialize();
                  var button = form.find("button");
                  var originalButtonText = button.text();
                  var statusLabel = $("#lock-status-label");
                  var eppButton = $("form.epp-form").find("button");
                  var eppFormMb = $(".epp-form-mb");
                  button.text("Lütfen bekleyiniz..");
                  button.prop("disabled", true);

                  $.ajax({
                    url: url,
                    method: method,
                    data: data,
                    success: function (response) {
                      $("#lockedstatus-message").hide();
                      $("#lockederror-message").hide();

                      if (response.status === "success") {
                        $("#lockedstatus-message-text").html(response.message);
                        $("#lockedstatus-message").show();

                        if (originalButtonText === "Aktif Edin") {
                          eppButton.prop("disabled", true);
                          button.text("Devre Dışı Bırak");
                          statusLabel.text("Aktif");
                          statusLabel.removeClass("label-danger bg-red-500").addClass("label-success bg-green-500");
                          eppFormMb.hide();
                        }
                        if (originalButtonText === "Devre Dışı Bırak") {
                          eppButton.prop("disabled", false);
                          button.text("Aktif Edin");
                          statusLabel.text("Pasif");
                          statusLabel.removeClass("label-success bg-green-500").addClass("label-danger bg-red-500");
                          eppFormMb.show();
                        }
                      } else {
                        $("#lockederror-message-text").html(response.message);
                        $("#lockederror-message").show();
                        button.text(originalButtonText);
                      }
                    },
                    error: function (xhr, status, error) {
                      $("#lockedstatus-message").hide();
                      $("#lockederror-message").hide();
                      $("#lockederror-message-text").html("Bir hata oluştu. Lütfen tekrar deneyin.");
                      $("#lockederror-message").show();

                      button.text(originalButtonText);
                    },
                    complete: function () {
                      button.prop("disabled", false);
                    },
                  });
                });
              });



              $(document).ready(function () {
                $(document).on("submit", "form.nameserver-form", function (e) {
                  e.preventDefault();
                  var form = $(this);
                  var url = form.attr("action");
                  var method = form.attr("method");
                  var data = form.serialize();
                  var button = form.find("button");
                  var originalButtonText = button.text();

                  button.text("Lütfen bekleyiniz..");
                  button.prop("disabled", true);

                  $.ajax({
                    url: url,
                    method: method,
                    data: data,
                    success: function (response) {
                      $("#lockedstatus-message").hide();
                      $("#lockederror-message").hide();

                      if (response.status === "success") {
                        $("#lockedstatus-message-text").html(response.message);
                        $("#lockedstatus-message").show();
                      } else {
                        $("#lockederror-message-text").html(response.message);
                        $("#lockederror-message").show();
                      }

                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                    error: function (xhr, status, error) {
                      $("#lockedstatus-message").hide();
                      $("#lockederror-message").hide();
                      $("#lockederror-message-text").html("Bir hata oluştu. Lütfen tekrar deneyin.");
                      $("#lockederror-message").show();

                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                  });
                });
              });

              $(document).ready(function () {
                $(document).on("submit", "form.addnameserver-form", function (e) {
                  e.preventDefault();
                  var form = $(this);
                  var url = form.attr("action");
                  var method = form.attr("method");
                  var data = form.serialize();
                  var button = form.find("button");
                  var originalButtonText = button.text();

                  button.text("Lütfen bekleyiniz..");
                  button.prop("disabled", true);

                  $.ajax({
                    url: url,
                    method: method,
                    data: data,
                    success: function (response) {
                      $("#addnameserverstatus-message").hide();
                      $("#addnameservererror-message").hide();

                      if (response.status === "success") {
                        $("#addnameserverstatus-message-text").html(response.message);
                        $("#addnameserverstatus-message").show();
                      } else {
                        $("#addnameservererror-message-text").html(response.message);
                        $("#addnameservererror-message").show();
                      }

                      // Buton ismini geri değiştir
                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                    error: function (xhr, status, error) {
                      $("#addnameserverstatus-message").hide();
                      $("#addnameservererror-message").hide();
                      $("#addnameservererror-message-text").html("Bir hata oluştu. Lütfen tekrar deneyin.");
                      $("#addnameservererror-message").show();

                      // Buton ismini geri değiştir
                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                  });
                });
              });

              $(document).ready(function () {
                $(document).on("submit", "form.updateaddnameserver-form", function (e) {
                  e.preventDefault();
                  var form = $(this);
                  var url = form.attr("action");
                  var method = form.attr("method");
                  var data = form.serialize();
                  var button = form.find("button");
                  var originalButtonText = button.text();

                  button.text("Lütfen bekleyiniz..");
                  button.prop("disabled", true);

                  $.ajax({
                    url: url,
                    method: method,
                    data: data,
                    success: function (response) {
                      $("#updateaddnameserverstatus-message").hide();
                      $("#updateaddnameservererror-message").hide();

                      if (response.status === "success") {
                        $("#updateaddnameserverstatus-message-text").html(response.message);
                        $("#updateaddnameserverstatus-message").show();
                      } else {
                        $("#updateaddnameservererror-message-text").html(response.message);
                        $("#updateaddnameservererror-message").show();
                      }

                      // Buton ismini geri değiştir
                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                    error: function (xhr, status, error) {
                      $("#updateaddnameserverstatus-message").hide();
                      $("#updateaddnameservererror-message").hide();
                      $("#updateaddnameservererror-message-text").html("Bir hata oluştu. Lütfen tekrar deneyin.");
                      $("#updateaddnameservererror-message").show();

                      // Buton ismini geri değiştir
                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                  });
                });
              });

              $(document).ready(function () {
                $(document).on("submit", "form.deleteaddnameserver-form", function (e) {
                  e.preventDefault();
                  var form = $(this);
                  var url = form.attr("action");
                  var method = form.attr("method");
                  var data = form.serialize();
                  var button = form.find("button");
                  var originalButtonText = button.text();

                  button.text("Lütfen bekleyiniz..");
                  button.prop("disabled", true);

                  $.ajax({
                    url: url,
                    method: method,
                    data: data,
                    success: function (response) {
                      $("#deleteaddnameserverstatus-message").hide();
                      $("#deleteaddnameservererror-message").hide();

                      if (response.status === "success") {
                        $("#deleteaddnameserverstatus-message-text").html(response.message);
                        $("#deleteaddnameserverstatus-message").show();
                      } else {
                        $("#deleteaddnameservererror-message-text").html(response.message);
                        $("#deleteaddnameservererror-message").show();
                      }

                      // Buton ismini geri değiştir
                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                    error: function (xhr, status, error) {
                      $("#deleteaddnameserverstatus-message").hide();
                      $("#deleteaddnameservererror-message").hide();
                      $("#deleteaddnameservererror-message-text").html("Bir hata oluştu. Lütfen tekrar deneyin.");
                      $("#deleteaddnameservererror-message").show();

                      // Buton ismini geri değiştir
                      button.text(originalButtonText);
                      button.prop("disabled", false);
                    },
                  });
                });
              });
</script>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        const form = document.querySelector(".hostingrenew-form");
        const selectElement = form.querySelector('select[name="period"]');

        selectElement.addEventListener("change", function () {
            if (selectElement.value) {
                // Seçili option'ı geçici olarak sakla
                const selectedOption = selectElement.options[selectElement.selectedIndex];
                const originalText = selectedOption.text;

                // Seçenek metnini "Bekleyiniz..." olarak değiştir
                selectedOption.text = "Bekleyiniz...";

                const formData = new FormData(form);

                fetch("<?php echo e(route('domain.save')); ?>", {
                    method: "POST",
                    body: formData,
                    headers: {
                        "X-CSRF-TOKEN": "<?php echo e(csrf_token()); ?>",
                        Accept: "application/json",
                    },
                })
                .then((response) => {
                    if (!response.ok) {
                        throw new Error("HTTP hatası: " + response.status);
                    }
                    return response.json();
                })
                .then((data) => {
                    if (data.success && data.invoiceid) {
                        // Başarılı yanıt ve invoiceid varsa yönlendir
                        window.location.href = `https://sspanel.serversistemleri.com/invoices/view/${data.invoiceid}`;
                    } else {
                        alert("İşlem başarısız oldu: " + (data.message || "Bilinmeyen bir hata oluştu."));
                        selectedOption.text = originalText; // Eski seçeneği geri yükle
                    }
                })
                .catch((error) => {
                    console.error("Hata:", error);
                    alert("Bir hata oluştu. Lütfen tekrar deneyin.");
                    selectedOption.text = originalText; // Hata durumunda eski metni geri al
                });
            }
        });
    });
</script>
    </main>
    <?php echo $__env->make("layouts.footer", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php /**PATH /home/ssplus/sspanel.serversistemleri.com/resources/views/domains_details.blade.php ENDPATH**/ ?>