@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&display=swap');


:root {
    --primary-color: #fce4ec;
    --secondary-color: #d1c4e9;
    --text-color-dark: #333;
    --text-color-light: #555;
    --accent-pink: #f06292;
    --accent-purple: #7b4397;
    --bg-light: #f9f9f9;
    --navbar-bg: white;
    --navbar-text: #555;
}

/* ====== GLOBAL ====== */
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: linear-gradient(to bottom right, var(--primary-color), var(--secondary-color));
    background-attachment: fixed;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text-color-dark);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ====== NAVBAR ====== */
.navbar {
    background-color: transparent;
    backdrop-filter: none;
    box-shadow: none;
    padding: 15px 0;
    position: relative;
    top: auto;
    z-index: auto;
    border-bottom: none;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 400;
    font-size: 2em;
    color: var(--accent-purple);
    text-decoration: none;
}

.navbar nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.navbar nav ul li .nav-link {
    font-family: 'Plus Jakarta Sans', sans-serif;
    text-decoration: none;
    color: var(--navbar-text);
    font-weight: 600;
    font-size: 1em;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.navbar nav ul li .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-pink);
    transition: width 0.3s ease;
}

.navbar nav ul li .nav-link:hover::after,
.navbar nav ul li .nav-link.active::after {
    width: 100%;
}

.navbar nav ul li .nav-link:hover,
.navbar nav ul li .nav-link.active {
    color: var(--accent-pink);
}


/* ================= HERO SECTION ================= */
.hero-section {
    padding: 100px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.hero-content {
    flex: 1;
    min-width: 300px;
    max-width: 55%;
    text-align: left;
    color: var(--text-color-dark);
    padding-top: 30px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5em;
    color: var(--accent-purple);
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero-description {
    font-size: 1.15em;
    color: var(--text-color-light);
    margin-bottom: 35px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 20px;
    margin-bottom: 40px;
}

.primary-button, .secondary-button {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.primary-button {
    background-color: var(--accent-pink);
    color: white;
    border: 2px solid var(--accent-pink);
}

.primary-button:hover {
    background-color: var(--accent-purple);
    border-color: var(--accent-purple);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.secondary-button {
    background-color: white;
    color: var(--accent-pink);
    border: 2px solid var(--accent-pink);
}

.secondary-button:hover {
    background-color: var(--accent-pink);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.hero-image-container {
    flex: 1;
    min-width: 280px;
    max-width: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image {
    width: 340px;
    height: 340px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border: 6px solid var(--accent-pink);
    transition: transform 0.3s ease-in-out;
}

.hero-image:hover {
    transform: scale(1.03);
}

/* ================= SHAPES ================= */
.abstract-shape {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.25;
    z-index: 0.3;
    filter: blur(1px);
}

.shape-1 {
    background-image: url('../images/shape.png');
    width: 100px;
    height: 100px;
    top: 0%;
    left: 8%;
    transform: rotate(-20deg);
}

.shape-2 {
    background-image: url('../images/shape.png');
    width: 100px;
    height: 100px;
    bottom: 15%;
    left: 2%;
    transform: rotate(45deg);
}

.shape-3 {
    background-image: url('../images/shape.png');
    width: 180px;
    height: 180px;
    top: 10%;
    right: 5%;
    transform: rotate(15deg);
}

.shape-4 {
    background-image: url('../images/shape.png');
    width: 90px;
    height: 90px;
    bottom: 8%;
    right: 18%;
    transform: rotate(-60deg);
}

.shape-5 {
    background-image: url('../images/shape.png');
    width: 120px;
    height: 120px;
    top: 40%;
    left: 30%;
    transform: rotate(90deg);
}

/* ================= CONTENT SECTION ================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 20px;
    max-width: 1200px;
    margin: 20px auto;
    background-color: var(--bg-light);
    border-radius: 15px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 3em;
    color: var(--accent-purple);
    margin-bottom: 40px;
    text-align: center;
}


/* Predict Page Styling */
.predict-section .content-wrapper {
    display: flex;
    gap: 40px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.card {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 900px;
    max-width: 450px;
}

/* UPLOAD CARD SPECIFIC STYLING (LOKASI UNTUK MENGATUR LEBAR KARTU UPLOAD) */
.upload-card {
    min-height: unset; /* hilangkan tinggi paksa */
    justify-content: flex-start; /* elemen tidak didorong ke bawah */
    gap: 20px; /* tambahkan agar antar elemen tetap punya jarak */
    flex-basis: 90%;
    max-width: 800px;
}


.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--secondary-color);
    border-radius: 10px;
    padding: 10px; /* lebih rapat */
    cursor: pointer;
    transition: border-color 0.3s ease;
    width: 100%;
    min-height: 150px; /* bisa diturunkan juga */
    margin-bottom: 10px; /* lebih sempit jaraknya ke bawah */
    position: relative;
}

.upload-area:hover {
    border-color: var(--accent-pink);
}

.upload-area input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 4em;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.upload-text {
    color: var(--text-color-light);
    font-size: 1em;
    margin-bottom: 15px;
}

/* Gaya untuk kontainer tombol di dalam upload-area */
#initialUploadOptions.upload-options-inside {
    display: flex; /* Jadikan flex untuk menata tombol */
    flex-direction: column; /* Tombol berjejer vertikal */
    align-items: center; /* Tengahkan tombol */
    width: 100%; /* Memenuhi lebar parent */
    gap: 6px; /* Jarak antar tombol */
    margin-top: 15px; /* Ini bisa diatur via margin-bottom pada .upload-text jika ingin lebih presisi */
}

.option-button {
    background-color: var(--accent-pink);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease;
    width: 100%;
    max-width: 300px;
}

.option-button:hover {
    background-color: var(--accent-purple);
    transform: translateY(-2px);
}

.cancel-button {
    background-color: #ccc;
    color: #333;
}

.cancel-button:hover {
    background-color: #bbb;
}
.camera-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px; /* Tetap di luar upload-area */
}

#cameraFeed {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transform: scaleX(-1);
}

#canvas {
    display: none;
}

/* Gaya untuk gambar preview saat berada di dalam .upload-area */
.upload-area .image-preview {
    max-width: 100%;
    max-height: 100%; /* Agar mengisi tinggi .upload-area */
    object-fit: contain; /* Gambar akan diskalakan agar muat tanpa terpotong */
    border-radius: 8px; /* Sesuaikan dengan border-radius upload-area */
    margin: auto; /* Pusatkan gambar di dalam flex container */
    display: none; /* Defaultnya tersembunyi, akan diubah oleh JS */
    position: absolute; /* Posisikan absolut untuk menumpuk konten awal */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px; /* Padding agar gambar tidak menempel garis putus-putus */
    box-sizing: border-box; /* Include padding in element's total width and height */
    background-color: white; /* Beri background putih agar menutupi ikon/teks di belakangnya */
}

.image-preview {
    max-width: 100%;
    max-height: 300px;
    height: auto;
    border-radius: 10px;
    object-fit: contain;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.predict-button-bottom {
    background-color: var(--accent-pink);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    margin-top: 40px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.predict-button-bottom:hover {
    background-color: var(--accent-purple);
    transform: translateY(-3px);
}

.result-card {
    justify-content: center;
    min-height: 400px;
}

.result-label {
    font-size: 1.2em;
    color: var(--text-color-light);
    margin-bottom: 15px;
}

.predicted-shape-container {
    background-color: var(--accent-pink);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    min-width: 200px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.predicted-shape-text {
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    font-weight: 700;
    text-transform: capitalize;
}

.confidence-percentage {
    font-size: 2em;
    font-weight: 600;
    color: var(--accent-purple);
}

/* Spinner for loading state */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--accent-pink);
    animation: spin 1s ease infinite;
    margin-top: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Camera Section Styling */
.camera-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#cameraFeed {
    width: 100%;
    max-height: 350px;
    background-color: #000;
    border-radius: 10px;
    object-fit: cover;
}

/* NEW: Styling untuk hiasan PNG */
.abstract-shape {
    position: absolute;
    background-size: contain; /* Agar gambar tidak terpotong dan proporsional */
    background-repeat: no-repeat;
    opacity: 0.6; /* Membuat sedikit transparan agar tidak terlalu mendominasi */
    z-index: 0.3; /* Pastikan di bawah konten utama */
}

.shape-1 { /* Contoh: meteor.png */
    background-image: url('../images/shape.png');
    width: 100px;
    height: 100px;
    top: 0%;
    left: 8%;
    transform: rotate(-20deg); /* Contoh rotasi */
    opacity: 0.3;
    filter: invert(63%) sepia(45%) saturate(624%) hue-rotate(308deg) brightness(94%) contrast(91%);
}

.shape-2 { /* Contoh: star_1.png */
    background-image: url('../images/shape.png');
    width: 100px;
    height: 100px;
    bottom: 15%;
    left: 2%;
    transform: rotate(45deg);
    opacity: 0.3;
    filter: invert(63%) sepia(45%) saturate(624%) hue-rotate(308deg) brightness(94%) contrast(91%);
}

.shape-3 { /* Contoh: flower.png */
    background-image: url('../images/shape.png');
    width: 180px;
    height: 180px;
    top: 10%;
    right: 5%;
    transform: rotate(15deg);
    opacity: 0.3;
    filter: invert(63%) sepia(45%) saturate(624%) hue-rotate(308deg) brightness(94%) contrast(91%);
}

.shape-4 { /* Contoh: star.png */
    background-image: url('../images/shape.png');
    width: 90px;
    height: 90px;
    bottom: 8%;
    right: 18%;
    transform: rotate(-60deg);
    opacity: 0.3;
    filter: invert(63%) sepia(45%) saturate(624%) hue-rotate(308deg) brightness(94%) contrast(91%);
}

.shape-5 { /* Contoh: shape.png */
    background-image: url('../images/shape.png');
    width: 120px;
    height: 120px;
    top: 40%;
    left: 30%;
    transform: rotate(90deg);
    opacity: 0.3;
    filter: invert(63%) sepia(45%) saturate(624%) hue-rotate(308deg) brightness(94%) contrast(91%);
}


/* All About Face Shape Page Styling */
.all-about-section {
    width: 100%;
}

.face-shapes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.shape-item {
    background-color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.3s ease;
}

.shape-item:hover {
    transform: translateY(-5px);
}

.shape-item img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 4px solid var(--accent-pink);
}

.shape-item h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8em;
    color: var(--accent-purple);
    margin-bottom: 10px;
}

.shape-item p {
    font-size: 1em;
    color: var(--text-color-light);
    line-height: 1.6;
}

/* Footer Styling */
.footer {
    background-color: var(--accent-purple);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    width: 100%;
}

.face-shape-slider {
    text-align: center;
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 0 auto;
}

.slider-content img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--accent-pink);
    margin-bottom: 20px;
}

.slider-content h4 {
    font-family: 'Playfair Display', serif;
    font-size: 2em;
    color: var(--accent-purple);
    margin-bottom: 10px;
}

.slider-content p {
    color: var(--text-color-light);
    font-size: 1em;
    line-height: 1.6;
}

.slider-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    gap: 20px;
}

.slider-controls button {
    background-color: var(--accent-pink);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-controls button:hover {
    background-color: var(--accent-purple);
}
 
/* Responsive Design */
@media (max-width: 992px) {
    .navbar-content {
        flex-direction: column;
        gap: 15px;
        padding: 0 20px; /* Pastikan padding tetap ada untuk mobile */
    }
    .navbar nav ul {
        justify-content: center;
        gap: 20px;
    }
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 60px 20px;
        max-width: none; /* Izinkan mengambil lebar penuh */
        margin: 0 auto;
    }
    .hero-content {
        max-width: 100%;
        margin-top: 0; /* Reset margin untuk layar kecil */
        margin-right: 0; /* Reset margin untuk layar kecil */
        padding: 0 20px; /* Tambahkan padding agar tidak terlalu mepet */
    }
    .hero-image-container {
        max-width: 100%;
    }
    .hero-buttons {
        justify-content: center;
    }
    .hero-title {
        font-size: 3em;
    }
    .section-title {
        font-size: 2.5em;
    }
    .predict-section .content-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    .card {
        max-width: 500px;
    }
    .hero-image {
        width: 280px;
        height: 280px;
    }
    /* Logo dan Navbar ul tidak perlu padding-left/right di sini karena sudah diatur di navbar-content */
}

@media (max-width: 768px) {
    .navbar nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero-title {
        font-size: 2.8em;
    }
    .hero-description {
        font-size: 1em;
    }
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    .primary-button, .secondary-button {
        width: 80%;
        max-width: 250px;
    }
    .main-content {
        margin: 20px auto;
    }
    .content-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    .card {
        min-width: unset;
        width: 100%;
        max-width: 400px;
    }
    .upload-card, .result-card {
        min-height: 300px;
    }
    .confidence-percentage {
        font-size: 3em;
    }
    .predict-button-bottom {
        padding: 12px 30px;
        font-size: 1em;
    }
    .camera-section {
        max-width: 100%;
    }
    #cameraFeed {
        max-height: 250px;
    }

    .all-about-section .section-title {
        font-size: 2em;
    }
    .face-shapes-grid {
        grid-template-columns: 1fr;
    }
    .shape-item img {
        width: 100px;
        height: 100px;
    }
    .hero-image {
        width: 220px;
        height: 220px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5em;
    }
    .logo {
        font-size: 1.5em;
    }
    .navbar nav ul {
        gap: 15px;
    }
    .navbar nav ul li .nav-link {
        font-size: 0.9em;
    }
    .section-title {
        font-size: 1.8em;
    }
    .predict-button-bottom {
        width: 90%;
    }
    .preview-item img {
        width: 60px;
        height: 60px;
    }
    .preview-item p {
        font-size: 0.9em;
    }
    .hero-image {
        width: 180px;
        height: 180px;
    }
}

#cameraFeed {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
    background-color: #000;
}

