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

:root {
    --primary-color: #e1306c;
    --primary-dark: #c13584;
    --secondary-color: #405de6;
    --gradient: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    --text-dark: #262626;
    --text-light: #8e8e8e;
    --bg-light: #fafafa;
    --white: #ffffff;
    --border: #dbdbdb;
    --success: #00c851;
    --error: #ff4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Top Navigation */
.top-nav {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.logo-section i {
    font-size: 32px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    background: var(--bg-light);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.language-selector:hover {
    background: var(--border);
}

.language-selector i {
    font-size: 14px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.header-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Content Tabs */
.content-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 20px 0 0 0;
    flex-wrap: wrap;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tab-btn i {
    font-size: 16px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.9);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
}

/* Header Content */
.header-content {
    padding: 40px 20px;
    color: var(--white);
}

.header-content h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--white);
}

.subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Old logo styles for backward compatibility */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo i {
    font-size: 48px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Download Section */
.download-section {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.url-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
}

.url-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(225, 48, 108, 0.1);
}

.url-input::placeholder {
    color: var(--text-light);
}

.download-btn {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    background: var(--gradient);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225, 48, 108, 0.3);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Error Message */
.error-message {
    display: none;
    padding: 12px 16px;
    background: #ffebee;
    color: var(--error);
    border-radius: 8px;
    border-left: 4px solid var(--error);
    margin-bottom: 20px;
}

.error-message.show {
    display: block;
}

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

.loading-spinner.show {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-spinner p {
    color: var(--text-light);
    font-size: 14px;
}

/* Result Section */
.result-section {
    display: none;
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.result-section.show {
    display: block;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.result-header h2 {
    font-size: 24px;
    color: var(--text-dark);
}

.clear-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
}

.clear-btn:hover {
    color: var(--text-dark);
}

/* Result Content */
.result-content {
    display: grid;
    gap: 20px;
}

.media-item {
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--white);
}

.media-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* New Mobile-like Layout */
.media-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0;
    min-height: 500px;
}

.media-thumbnail {
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.media-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #833ab4, #fd1d1d);
    color: white;
    font-size: 80px;
}

.media-type-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    background: var(--gradient);
    color: var(--white);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.media-details {
    padding: 30px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto;
}

/* Post Info Section */
.post-info {
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

.post-caption {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
    margin-bottom: 15px;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.5em;
}

.post-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    font-size: 13px;
}

.stat-item i {
    font-size: 16px;
    color: var(--text-light);
}

.stat-item span {
    font-weight: 500;
}

/* Old styles for backward compatibility */
.media-preview {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.media-info {
    padding: 20px;
    background: var(--bg-light);
}

.media-type {
    display: inline-block;
    padding: 6px 12px;
    background: var(--gradient);
    color: var(--white);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.media-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225, 48, 108, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

/* Carousel Grid */
.carousel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.carousel-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.carousel-item img,
.carousel-item video {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.carousel-download {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.carousel-download:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Features */
.features {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.features h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.feature-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: var(--bg-light);
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 48px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-light);
    font-size: 14px;
}

/* How To */
.how-to {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.how-to h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 25px;
    max-width: 800px;
    margin: 0 auto;
}

.step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: var(--gradient);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

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

.step-content p {
    color: var(--text-light);
    font-size: 14px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    color: var(--text-light);
    font-size: 14px;
}

.footer p {
    margin-bottom: 5px;
}

.disclaimer {
    font-size: 12px;
    color: var(--text-light);
}

/* Quality Options */
.quality-options {
    flex: 1;
}

.download-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 600;
}

.quality-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quality-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.quality-item:hover {
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 2px 8px rgba(225, 48, 108, 0.1);
}

.quality-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.quality-info i {
    font-size: 20px;
}

.quality-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.quality-size {
    margin-left: auto;
    color: var(--text-light);
    font-size: 13px;
    padding: 4px 10px;
    background: var(--white);
    border-radius: 12px;
}

.quality-btn {
    padding: 10px 20px;
    background: var(--gradient);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quality-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225, 48, 108, 0.3);
}

.quality-btn i {
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
    }

    .logo-section {
        font-size: 20px;
    }

    .logo-section i {
        font-size: 28px;
    }

    .logo-text {
        font-size: 20px;
    }

    .nav-links {
        gap: 15px;
    }

    .language-selector {
        padding: 6px 12px;
        font-size: 13px;
    }

    .content-tabs {
        padding: 15px 10px 0 10px;
        gap: 5px;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 13px;
    }

    .tab-btn span {
        display: none;
    }

    .tab-btn i {
        font-size: 18px;
    }

    .header-content h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 14px;
    }

    .logo h1 {
        font-size: 24px;
    }

    .logo i {
        font-size: 36px;
    }

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

    .download-btn {
        justify-content: center;
    }

    .download-section {
        padding: 25px;
    }

    .features,
    .how-to {
        padding: 25px;
    }

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

    .media-actions {
        flex-direction: column;
    }

    .carousel-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .quality-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .quality-info {
        width: 100%;
        flex-wrap: wrap;
    }

    .quality-size {
        margin-left: 0;
    }

    .quality-btn {
        width: 100%;
        justify-content: center;
    }

    /* Mobile layout - stack vertically */
    .media-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .media-thumbnail {
        min-height: 400px;
    }

    .media-details {
        padding: 20px;
    }

    .post-stats {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 25px 15px;
    }

    .logo {
        flex-direction: column;
        gap: 10px;
    }

    .download-section {
        padding: 20px;
    }
}
