/* ==========================================================================
   TikTok Mediasave - Premium Dark Theme CSS
   Author: Pembri
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #f1f1f1;
    background-color: #121214; /* Dark pekat */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #00f2fe; /* Cyan neon khas TikTok */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.header-container,
.content-container,
.footer-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Header & Navigation Global
   ========================================================================== */
.site-header {
    background-color: #1a1a1e;
    border-bottom: 1px solid #2f2f35;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.site-logo:hover {
    text-decoration: none;
}

.accent-text {
    color: #ee1d52; /* Merah/Pink neon khas TikTok */
    text-shadow: 0 0 10px rgba(238, 29, 82, 0.3);
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-link {
    color: #a1a1aa;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #ffffff;
    background-color: #2a2a30;
    text-decoration: none;
}

.nav-link.active {
    color: #00f2fe;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-bar {
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

/* ==========================================================================
   Main Layout & Downloader Card
   ========================================================================== */
.main-content {
    flex: 1;
    padding: 50px 0;
}

.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #ffffff;
}

.hero-section p {
    font-size: 1.1rem;
    color: #a1a1aa;
    max-width: 600px;
    margin: 0 auto;
}

.downloader-wrapper {
    max-width: 650px;
    margin: 0 auto 60px auto;
}

.card {
    background-color: #1a1a1e;
    border: 1px solid #2f2f35;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group label {
    font-weight: 500;
    font-size: 0.95rem;
    color: #e4e4e7;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid #2f2f35;
    border-radius: 8px;
    background-color: #252529;
    color: #ffffff;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #00f2fe;
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.25);
}

.form-group textarea {
    resize: vertical;
    min-height: 130px;
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(90deg, #ee1d52, #00f2fe);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-success {
    color: #ffffff;
    background-color: #00f2fe;
    color: #121214;
}

.btn-success:hover {
    background-color: #05d5e0;
}

.btn-audio {
    color: #ffffff;
    background-color: #ee1d52;
}

.btn-audio:hover {
    background-color: #d61445;
}

.btn-back {
    background-color: #252529;
    color: #a1a1aa;
    border: 1px solid #2f2f35;
}

.btn-back:hover {
    color: #ffffff;
    background-color: #2a2a30;
}

.hidden {
    display: none !important;
}

/* Loading & Spinner */
.loading-wrapper {
    text-align: center;
    padding: 30px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #252529;
    border-top: 4px solid #00f2fe;
    border-bottom: 4px solid #ee1d52;
    border-radius: 50%;
    margin: 0 auto 16px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-wrapper p {
    font-size: 0.95rem;
    color: #a1a1aa;
}

/* ==========================================================================
   Result Preview Layout
   ========================================================================== */
.result-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.media-preview {
    display: flex;
    gap: 16px;
    background-color: #252529;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #2f2f35;
    align-items: center;
}

#res-thumbnail {
    width: 90px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #2f2f35;
    background-color: #121214;
}

.media-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

#res-author {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

#res-desc {
    font-size: 0.9rem;
    color: #a1a1aa;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Alert Boxes */
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
    border: 1px solid transparent;
    margin-top: 20px;
}

.alert-danger {
    background-color: rgba(238, 29, 82, 0.1);
    border-color: rgba(238, 29, 82, 0.3);
    color: #ff4d6d;
}

/* Grid Kelebihan Section */
.guide-section {
    border-top: 1px solid #2f2f35;
    padding-top: 50px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.guide-card {
    background-color: #1a1a1e;
    border: 1px solid #2f2f35;
    border-radius: 8px;
    padding: 24px;
}

.guide-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
}

.guide-card p {
    font-size: 0.9rem;
    color: #a1a1aa;
    line-height: 1.6;
}

/* Pop-up Overlay & Success Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background-color: #1a1a1e;
    border: 1px solid #2f2f35;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    background-color: rgba(0, 242, 254, 0.1);
    color: #00f2fe;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 50%;
    margin-bottom: 16px;
}

.modal-btn {
    margin-top: 24px;
    width: auto;
    padding: 10px 30px;
}

/* ==========================================================================
   Footer Global
   ========================================================================== */
.site-footer {
    background-color: #1a1a1e;
    border-top: 1px solid #2f2f35;
    padding: 24px 0;
    text-align: center;
    font-size: 0.9rem;
    color: #a1a1aa;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #1a1a1e;
        border-bottom: 1px solid #2f2f35;
        padding: 24px;
        display: none;
    }

    .nav-menu.active {
        display: block;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    /* Hamburger Animation to 'X' */
    .menu-toggle.active .hamburger-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active .hamburger-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .guide-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hero-section h1 {
        font-size: 2rem;
    }
}
