/* ApaTik - Clean White Minimalist Theme */
:root {
    --bg-main: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --primary-blue: #2563eb;
    --primary-blue-hover: #1d4ed8;
    --accent-blue-light: #eff6ff;
    --accent-green: #10b981;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --radius-btn: 10px;
    --radius-card: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header Navbar */
.navbar {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    border-radius: var(--radius-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.logo span {
    color: var(--primary-blue);
}

.nav-website-btn {
    background: var(--accent-blue-light);
    color: var(--primary-blue);
    border: 1px solid rgba(37, 99, 235, 0.25);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.nav-website-btn:hover {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 50px 0 30px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Downloader Form Card */
.downloader-box {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 36px;
}

.input-group {
    display: flex;
    gap: 12px;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.url-input {
    width: 100%;
    padding: 18px 110px 18px 50px;
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-btn);
    color: var(--text-dark);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.url-input:focus {
    border-color: var(--primary-blue);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.btn-paste {
    position: absolute;
    right: 10px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-paste:hover {
    background: var(--bg-main);
    color: var(--text-dark);
}

.btn-submit {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0 32px;
    border-radius: var(--radius-btn);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-submit:hover {
    background: var(--primary-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* Alert Box */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-btn);
    margin-bottom: 24px;
    display: none;
    font-size: 0.95rem;
    align-items: center;
    gap: 12px;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

/* Loading Spinner */
.spinner-container {
    display: none;
    text-align: center;
    padding: 30px 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-left-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

/* Result Section */
.result-card {
    display: none;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 28px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
}

.result-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
}

.preview-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 9/16;
    background: #0f172a;
    border: 1px solid var(--border-color);
}

.preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-fallback {
    width: 100%;
    height: 100%;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--primary-blue);
    font-size: 2.5rem;
}

.thumb-fallback span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 5;
}

.avatar-wrapper {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.author-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
    background-color: #cbd5e1;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid white;
    background: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.author-info h4 {
    font-size: 0.95rem;
    color: white;
    font-weight: 700;
    line-height: 1.2;
}

.author-info p {
    font-size: 0.8rem;
    color: #e2e8f0;
}

/* Details & Action Buttons Stack */
.details-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.video-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    border-radius: var(--radius-btn);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    color: white;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

/* Clean Blue Button Primary Styles */
.btn-primary-blue {
    background: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary-blue:hover {
    background: var(--primary-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-secondary-blue {
    background: #1e40af;
}

.btn-secondary-blue:hover {
    background: #1e3a8a;
}

.btn-outline-blue {
    background: var(--accent-blue-light);
    color: var(--primary-blue);
    border: 1.5px solid rgba(37, 99, 235, 0.3);
}

.btn-outline-blue:hover {
    background: rgba(37, 99, 235, 0.12);
}

.btn-reset {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    margin-top: 6px;
}

.btn-reset:hover {
    background: #e2e8f0;
    color: var(--text-dark);
}

/* Photo Slideshow Gallery Grid */
.photo-gallery-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.photo-item {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-btn);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.photo-item img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    display: block;
}

.photo-item .btn-dl-photo {
    margin: 10px;
    padding: 10px;
    background: var(--primary-blue);
    color: white;
    text-align: center;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}

.photo-item .btn-dl-photo:hover {
    background: var(--primary-blue-hover);
}

/* Guide / Tutorial Section */
.guide-section {
    padding: 50px 0;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 28px;
    text-align: center;
    color: var(--text-dark);
}

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

.step-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.step-num {
    width: 38px;
    height: 38px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.step-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.step-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Footer */
footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 28px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-white);
}

/* Responsive */
@media (max-width: 768px) {
    .result-grid {
        grid-template-columns: 1fr;
    }

    .preview-container {
        max-width: 240px;
        margin: 0 auto;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 1.9rem;
    }

    .input-group {
        flex-direction: column;
    }

    .url-input {
        padding-right: 90px;
    }

    .btn-submit {
        width: 100%;
        padding: 16px;
        justify-content: center;
    }
}
