/* home.css */
/* Styles untuk konten home section */

/* 1. Animation Variable Definition untuk animasi 3D */
@property --orbit-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

/* Spinning Text Styles */
.spinning-text-wrapper {
    display: block;
    position: relative;
    margin: 25px 0 20px 0;
}

.spinning-text-container {
    display: block;
    position: relative;
    height: 55px;
    text-align: left;
    margin: 0;
    overflow: none;
}

.spinning-text {
    display: block;
    width: 100%;
    color: var(--primary-yellow);
    font-weight: bold;
    font-size: 2.5rem;
    position: absolute;
    left: 0;
    right: 0;
    opacity: 0;
    transform: scale(0.8);
    transition: none;
    line-height: 1.1;
    top: 5px;
}

/* Animation Classes */
.text-zoom-in {
    animation: zoomIn 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.text-fade-out {
    animation: fadeOut 0.7s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

@keyframes zoomIn {
    0% {
        transform: scale(0.8) translateY(10px);
        opacity: 0;
        filter: blur(2px);
    }

    70% {
        transform: scale(1.05) translateY(0);
        filter: blur(0);
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes fadeOut {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: blur(0);
    }

    30% {
        transform: scale(1.1) translateY(-5px);
        filter: blur(1px);
    }

    100% {
        transform: scale(0.8) translateY(10px);
        opacity: 0;
        filter: blur(2px);
    }
}

/* Hero Section Styles */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9)),
        url("https://kursusbahasa.org/assets/img/gallery/kampung-inggris-pare.webp");
    background-size: cover;
    background-position: center;
    color: white;
    padding: 4rem 0;
    min-height: 60vh;
    overflow: hidden;
}

.hero-line {
    display: block;
    margin-bottom: 1px;
    line-height: 1.2;
}

.hero-main-title {
    font-size: 2.5rem;
    line-height: 1.1;
}

/* Hero Image Container untuk animasi 3D */
.hero-image-container {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* ===== STYLES UNTUK ANIMASI 3D OBLIQUE LOGO ORBIT ===== */

/* 2. Reset and Base untuk animasi */
.animation-3d-system * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 3. Main System Container */
.animation-3d-system {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
    transform-style: preserve-3d;
}

/* 4. Center Logo */
.animation-logo-container {
    z-index: 10;
    position: relative;
    width: 200px;
    height: 200px;
}

/* Efek mengapung untuk logo */
.animation-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    transition: all 0.3s ease;
    /* Efek mengapung */
    animation: logoFloat 6s ease-in-out infinite;
    transform-origin: center;
}

/* Animation untuk efek mengapung logo */
@keyframes logoFloat {
    0% {
        transform: translateY(0px) scale(1) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) scale(1.02) rotate(0.5deg);
    }

    50% {
        transform: translateY(-20px) scale(1.05) rotate(0deg);
    }

    75% {
        transform: translateY(-10px) scale(1.02) rotate(-0.5deg);
    }

    100% {
        transform: translateY(0px) scale(1) rotate(0deg);
    }
}

/* Efek cahaya pada logo */
.animation-logo::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle,
            rgba(255, 215, 0, 0.2) 0%,
            rgba(255, 215, 0, 0) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: logoGlow 4s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.9);
    }

    100% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* 5. Orbit Animation */
@keyframes orbit {
    from {
        --orbit-angle: 0deg;
    }

    to {
        --orbit-angle: 360deg;
    }
}

/* 6. Individual Flag Orbit Containers */
.animation-orbit {
    /* PERMANENT SETTINGS */
    --radius: 100px;
    --tilt: -0.3;
    /* This creates the oblique angle (0 to 1) */
    --orbit-speed: 5s;

    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    --current-angle: calc(var(--orbit-angle) + var(--angle-offset, 0deg));

    /* Calculated X and Y for an Oblique/Tilted Path */
    /* We multiply the Y component by a tilt factor and the X component to skew the ring */
    --pos-x: calc(cos(var(--current-angle)) * var(--radius));
    --pos-y: calc(sin(var(--current-angle)) * var(--radius) * 0.4);
    /* Ellipse depth */

    /* The 'Oblique' adjustment: Shift Y slightly based on X position */
    translate: var(--pos-x) calc(var(--pos-y) + (var(--pos-x) * var(--tilt)));

    /* Depth simulation: front vs back */
    /* We calculate depth based on the 'front-most' part of our tilted ring */
    z-index: calc(10 + (sin(var(--current-angle)) * 10));

    animation: orbit var(--orbit-speed) linear infinite;
    will-change: translate, z-index;
}

/* 7. Flag Styling */
.animation-flag {
    position: absolute;
    width: 50px;
    height: 35px;
    object-fit: cover;
    border-radius: 4px;

    /* Scale simulates distance, transform keeps them upright */
    transform: translate(-50%, -50%) scale(calc(0.85 + (sin(var(--current-angle)) * 0.35)));

    opacity: calc(0.75 + (sin(var(--current-angle)) * 0.25));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    /* Efek mengapung kecil pada bendera */
    animation: flagFloat 3s ease-in-out infinite;
    animation-delay: calc(var(--angle-offset, 0deg) * 0.05s);
}

.animation-flag:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
    border-color: var(--primary-yellow);
    z-index: 20;
}

/* Efek mengapung kecil untuk bendera */
@keyframes flagFloat {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(calc(0.85 + (sin(var(--current-angle)) * 0.35)));
    }

    50% {
        transform: translate(-50%, calc(-50% - 3px)) scale(calc(0.85 + (sin(var(--current-angle)) * 0.35)));
    }
}

/* ===== AKHIR STYLES ANIMASI 3D ===== */

/* ==================== PERBAIKAN MOBILE ==================== */

/* 2. Partners - Mobile Carousel (1 logo per slide) */
.partner-mobile-carousel {
    display: none;
}

.partner-desktop-carousel {
    display: block;
}

@media (max-width: 768px) {
    .partner-desktop-carousel {
        display: none;
    }

    .partner-mobile-carousel {
        display: block;
    }

    /* Carousel mobile dengan 1 logo per slide */
    #partnerMobileCarousel .carousel-item {
        padding: 0 15px;
    }

    #partnerMobileCarousel .carousel-logo {
        height: 50px;
        margin: 0 auto;
        max-width: 150px;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
        top: 50%;
        transform: translateY(-50%);
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 50%;
    }

    .carousel-control-prev {
        left: 5px;
    }

    .carousel-control-next {
        right: 5px;
    }
}

/* 3. Paket Kursus - Mobile Carousel (1 card per slide) */
.packages-desktop {
    display: flex;
}

.packages-mobile {
    display: none;
}

@media (max-width: 768px) {
    .packages-desktop {
        display: none;
    }

    .packages-mobile {
        display: block;
        margin: 0 -15px;
    }

    #languageTabContent .carousel {
        padding: 10px 0;
    }

    #languageTabContent .carousel-item {
        padding: 0 15px;
    }

    #languageTabContent .package-card {
        margin: 0 auto;
        max-width: 320px;
    }

    /* Carousel controls untuk paket kursus */
    #languageTabContent .carousel-control-prev,
    #languageTabContent .carousel-control-next {
        width: 40px;
        height: 40px;
        top: 50%;
        transform: translateY(-50%);
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 50%;
        opacity: 0.8;
    }

    #languageTabContent .carousel-control-prev {
        left: 5px;
    }

    #languageTabContent .carousel-control-next {
        right: 5px;
    }

    #languageTabContent .carousel-indicators {
        position: relative;
        margin-top: 15px;
        margin-bottom: 0;
    }

    #languageTabContent .carousel-indicators button {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        margin: 0 4px;
        background-color: #ccc;
        border: none;
    }

    #languageTabContent .carousel-indicators button.active {
        background-color: var(--primary-yellow);
    }
}

/* Responsive adjustments - DIGABUNG DAN DIBERSIHKAN */
@media (max-width: 992px) {
    .spinning-text-wrapper {
        margin: 20px 0 15px 0;
    }
}

@media (max-width: 768px) {
    .spinning-text-wrapper {
        margin: 15px 0 10px 0;
    }

    .spinning-text-container {
        height: 50px;
        text-align: left;
    }

    .spinning-text {
        font-size: 1.6rem;
    }

    .hero-main-title {
        font-size: 2rem;
        text-align: left;
    }

    .hero-section h1 {
        font-size: 1.8rem;
        text-align: left;
    }

    .package-card-body {
        padding: 1rem;
    }

    .package-card-title {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .spinning-text-wrapper {
        margin: 12px 0 8px 0;
    }

    .spinning-text-container {
        height: 45px;
        text-align: left;
    }

    .spinning-text {
        font-size: 1.4rem;
        text-align: left;
    }

    .hero-main-title {
        font-size: 1.6rem;
        text-align: left;
    }

    .hero-section {
        padding: 2.5rem 0;
    }

    .hero-section h1 {
        font-size: 1.5rem;
        text-align: left;
    }

    .carousel-logo {
        height: 40px;
    }

    .package-card {
        margin-bottom: 1.5rem;
    }
}

/* ==================== STYLE UNTUK GENERAL FEATURES ==================== */
.general-features-section {
    border-top: 1px solid var(--primary-yellow);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.general-feature-item {
    transition: transform 0.3s ease;
    border-radius: 10px;
    height: 100%;
    padding: 0.5rem;
}

.general-feature-item:hover {
    transform: translateY(-5px);
    background-color: rgba(255, 193, 7, 0.1);
}

.general-feature-item i {
    color: var(--primary-yellow);
    transition: color 0.3s ease;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.general-feature-item:hover i {
    color: #ffd700;
}

.general-feature-item h6 {
    color: var(--primary-yellow);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.general-feature-item .small {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--dark-gray);
}

/* Style untuk info tambahan bahasa */
.language-info-row {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 1rem;
    margin-top: 1.5rem;
}

.language-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.language-info-item i {
    color: var(--primary-yellow);
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.language-info-item .label {
    font-size: 0.85rem;
    color: var(--dark-gray);
    margin-right: 0.5rem;
}

.language-info-item .value {
    font-weight: 600;
    color: var(--primary-yellow);
}

/* General Component Styles */
.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-yellow);
    margin-bottom: 1rem;
}

.language-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.language-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-yellow);
}

.carousel-logo {
    height: 60px;
    filter: grayscale(0);
    opacity: 0.7;
    transition: filter 0.3s, opacity 0.3s;
}

.carousel-logo:hover {
    filter: grayscale(0);
    opacity: 1;
}

.kampung-section {
    background-color: var(--light-gray);
}

.nav-tabs .nav-link {
    color: var(--dark-gray);
}

.nav-tabs .nav-link.active {
    color: var(--black);
    border-bottom: 3px solid var(--primary-yellow);
    font-weight: bold;
}

/* Package Card Styles */
.package-card {
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    display: flex;
    flex-direction: column;
}

.package-card:hover {
    border-color: var(--primary-yellow);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.package-card-body {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.package-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--black);
}

.package-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.8rem;
}

.meta-badge {
    background-color: rgba(255, 215, 0, 0.1);
    color: var(--dark-gray);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.meta-badge.highlight {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.2);
}

.package-card-description {
    color: var(--dark-gray);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    flex-grow: 1;
}

.package-options-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.2rem 0;
    background-color: rgba(248, 249, 250, 0.8);
    border-radius: 6px;
    padding: 0.8rem;
}

.package-option-item {
    padding: 0.25rem 0;
    font-size: 0.8rem;
    color: var(--dark-gray);
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.package-option-item:last-child {
    border-bottom: none;
}

.package-option-item i {
    color: var(--primary-yellow);
    font-size: 0.7rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.package-card-footer {
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: auto;
}

.btn-package-detail {
    background-color: transparent;
    color: var(--primary-yellow);
    border: 1px solid var(--primary-yellow);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    width: 100%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
    cursor: pointer;
}

.btn-package-detail:hover {
    background-color: var(--primary-yellow);
    color: var(--black);
}

/* Responsive adjustments untuk smaller screens */
@media (max-width: 992px) {
    .animation-3d-system {
        perspective: 800px;
    }

    .animation-logo-container {
        width: 180px;
        height: 180px;
    }

    .animation-orbit {
        --radius: 80px;
    }

    .animation-flag {
        width: 45px;
        height: 31px;
    }
}

@media (max-width: 768px) {
    .animation-3d-system {
        perspective: 600px;
    }

    .animation-logo-container {
        width: 150px;
        height: 150px;
    }

    .animation-orbit {
        --radius: 70px;
        --orbit-speed: 4s;
    }

    .animation-flag {
        width: 40px;
        height: 28px;
    }

    @keyframes logoFloat {
        0% {
            transform: translateY(0px) scale(1);
        }

        50% {
            transform: translateY(-15px) scale(1.03);
        }

        100% {
            transform: translateY(0px) scale(1);
        }
    }

    .hero-image-container {
        padding: 10px;
    }

    /* Tulisan spinning text rata kiri */
    .spinning-text-wrapper {
        text-align: left;
        margin: 15px 0;
    }

    .spinning-text-container {
        text-align: left;
        height: 45px;
    }

    .spinning-text {
        font-size: 2.5rem;
        text-align: left;
    }

    /* Headline lebih besar */
    .hero-main-title {
        font-size: 2.5rem;
        text-align: left;
    }

    .hero-section h1 {
        text-align: left;
    }

    .hero-line {
        text-align: left;
    }

    /* Button di tengah */
    .hero-section .btn {
        width: 100%;
        margin-top: 20px;
    }
}

@media (max-width: 576px) {
    .animation-3d-system {
        perspective: 500px;
    }

    .animation-logo-container {
        width: 120px;
        height: 120px;
    }

    .animation-orbit {
        --radius: 60px;
    }

    .animation-flag {
        width: 35px;
        height: 24px;
    }

    @keyframes logoFloat {
        0% {
            transform: translateY(0px) scale(1);
        }

        50% {
            transform: translateY(-10px) scale(1.02);
        }

        100% {
            transform: translateY(0px) scale(1);
        }
    }

    .hero-main-title {
        font-size: 1.8rem;
    }

    .spinning-text {
        font-size: 1.7rem;
    }

    .hero-section {
        padding: 2.5rem 0;
    }
}