/* Custom styles to complement Bootstrap */
:root {
    --bs-primary: #0d6efd;
    --bs-primary-rgb: 13, 110, 253;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
}

/* General Styles */
html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

/* Animations */
.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hero Section */
.bg-primary {
    position: relative;
    background: linear-gradient(135deg, var(--bs-primary), #0143a3) !important;
}

/* Carousel Styles */
.carousel-item {
    transition: transform 0.6s ease-in-out;
}

.carousel-item i {
    transition: all 0.3s ease;
    transform: scale(1);
}

.carousel-item.active i {
    animation: iconPop 0.5s ease-out;
}

@keyframes iconPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    70% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.carousel-indicators {
    margin-bottom: 2rem;
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
}

.carousel-indicators button.active {
    background-color: white;
}

.bg-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5z' fill='rgba(255,255,255,0.05)' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.1;
}

/* Form Styles */
.form-control {
    border-radius: 0.5rem;
}

.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.input-group-text {
    border-radius: 0.5rem;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group:not(.has-validation) > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Button Styles */
.btn {
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    transition: transform 0.15s ease-in-out;
}

.btn-lg {
    padding: 1rem 2rem;
}

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn:hover {
    transform: translateY(-1px);
}

/* Feature Icons */
.rounded-circle {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Debug Info */
.card-body.bg-light {
    background-color: #f8f9fa !important;
}

/* Responsive Adjustments */
/* Desktop styles */
@media (min-width: 992px) {
    .hero-section {
        height: 100vh !important;
    }
    
    .login-container {
        min-height: 100vh !important;
    }
}

/* Mobile styles */
@media (max-width: 991.98px) {
    .container {
        max-width: 100%;
        padding: 1rem;
    }
    
    .row.min-vh-100 {
        flex-direction: column;
    }

    .hero-section {
        height: 45vh !important;
    }

    .hero-section .display-4 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .hero-section .lead {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .carousel-item .p-5 {
        padding: 1rem !important;
    }

    .carousel-item i.display-1 {
        font-size: 3rem !important;
        margin-bottom: 1rem !important;
    }

    .carousel-item .fs-1 {
        font-size: 1.5rem !important;
    }

    .carousel-item h4 {
        font-size: 1rem;
        margin-bottom: 0.25rem !important;
    }

    .carousel-item p.opacity-75 {
        font-size: 0.875rem;
    }

    .carousel-item .mt-4 {
        margin-top: 1rem !important;
    }

    .carousel-indicators {
        margin-bottom: 0.5rem;
    }

    .carousel-indicators [data-bs-target] {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.5);
        margin: 0 4px;
    }

    .carousel-indicators .active {
        background-color: white;
    }

    .login-container {
        height: 55vh !important;
        padding-top: 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start !important;
    }

    .login-container img {
        max-width: 100px !important;
        margin: 1rem 0;
    }

    .login-container .btn {
        margin-top: auto;
        margin-bottom: 2rem;
    }
}

/* Animations */
.btn, .form-control, .input-group-text {
    transition: all 0.2s ease-in-out;
}

/* Accessibility */
.btn:focus, .form-control:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* === Hero Carousel Gambar WiFi Publik === */
.hero-section {
    position: relative;
    min-height: 60vh;
}

#welcomeCarousel,
#welcomeCarousel .carousel-inner,
#welcomeCarousel .carousel-item {
    height: 100%;
}

#welcomeCarousel .carousel-item > img {
    width: 100%;
    height: 100%;
    object-fit: cover;       /* isi penuh tanpa distorsi */
    object-position: center; /* fokus tengah */
    display: block;
}

/* tombol navigasi opsional */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(1) drop-shadow(0 0 2px rgba(0,0,0,.5));
}

/* indikator carousel */
.carousel-indicators {
    bottom: 1.5rem;
}

.carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.6);
    margin: 0 4px;
}

.carousel-indicators .active {
    background-color: #fff;
}

/* responsive */
@media (max-width: 991.98px) {
    .hero-section {
        height: 45vh !important;
    }

    #welcomeCarousel .carousel-item > img {
        object-position: center top;
    }
}

/* ==== Fix flicker / blue flash on slide ==== */
/* Pakai transisi fade, bukan geser */
#welcomeCarousel.carousel-fade .carousel-item {
  opacity: 0;
  transition: opacity .6s ease-in-out;
  transform: none;            /* cegah pergeseran yang memunculkan bg */
}

#welcomeCarousel.carousel-fade .carousel-item.active,
#welcomeCarousel.carousel-fade .carousel-item-next.carousel-item-start,
#welcomeCarousel.carousel-fade .carousel-item-prev.carousel-item-end {
  opacity: 1;
}

#welcomeCarousel.carousel-fade .active.carousel-item-start,
#welcomeCarousel.carousel-fade .active.carousel-item-end {
  opacity: 0;
}

/* Pastikan gambar menutup penuh tanpa celah */
#welcomeCarousel,
#welcomeCarousel .carousel-inner,
#welcomeCarousel .carousel-item {
  height: 100%;
  background: #000;           /* fallback hitam agar tidak terlihat gradient */
}

#welcomeCarousel .carousel-item > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Nonaktifkan pattern overlay biru di sisi kiri hanya untuk hero */
.hero-section.bg-primary::before {
  display: none;
}

/* Mobile: sedikit geser fokus gambar ke atas agar komposisi enak */
@media (max-width: 991.98px) {
  #welcomeCarousel .carousel-item > img { object-position: center top; }
}

/* === Responsive: kecilkan logo Kota Tegal di mobile === */
@media (max-width: 767.98px) {
  .login-container img.logo-img {
    max-width: 45px !important;  /* semula 60px di desktop */
  }

  /* kalau ingin tulisan "Amazing Tegal" ikut proporsional */
  .login-container img[alt*="Amazing"] {
    max-width: 180px !important; /* semula 300px */
  }
}
