/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark: #1f2937;
    --light: #f3f4f6;
    --white: #ffffff;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
}

body[dir="rtl"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo i {
    font-size: 2rem;
}

.lang-switcher {
    display: flex;
    gap: 10px;
}

.lang-switcher a {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--dark);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.lang-switcher a.active,
.lang-switcher a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    color: var(--white);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Ad Container */
.ad-container {
    margin: 2rem 0;
}

.ad-placeholder {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    color: #999;
    border: 2px dashed #ddd;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content */
.main-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--light);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--dark);
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn i {
    font-size: 1.5rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Converter Options */
.converter-options,
.downloader-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.option-card,
.platform-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--white);
    box-shadow: var(--shadow);
}

.option-card:hover,
.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.option-card.selected,
.platform-card.selected {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.option-card i,
.platform-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.option-card h3,
.platform-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.option-card p {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Upload Section */
.upload-section,
.download-section {
    margin-top: 2rem;
}

.upload-area {
    border: 3px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 1.5rem;
}

.upload-area:hover {
    background: var(--light);
    border-color: var(--secondary-color);
}

.upload-area i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-area p {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.upload-area input[type="file"] {
    display: none;
}

/* URL Input */
.url-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
}

.url-input-wrapper i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-right: 1rem;
}

[dir="rtl"] .url-input-wrapper i {
    margin-right: 0;
    margin-left: 1rem;
}

.url-input-wrapper input {
    flex: 1;
    border: none;
    background: none;
    padding: 1rem;
    font-size: 1rem;
    outline: none;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-primary i {
    font-size: 1.3rem;
}

/* Result */
.result {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--light);
    border-radius: var(--border-radius);
    text-align: center;
    display: none;
}

.result.show {
    display: block;
    animation: slideDown 0.5s;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result.success {
    background: #d1fae5;
    color: var(--success-color);
}

.result.error {
    background: #fee2e2;
    color: var(--danger-color);
}

/* Features Section */
.features {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

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

.feature-card {
    text-align: center;
    padding: 2rem;
    background: var(--light);
    border-radius: var(--border-radius);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.feature-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    color: var(--dark);
}

/* How to Use Section */
.how-to-use {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.how-to-use h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

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

.step {
    text-align: center;
    padding: 2rem;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.step p {
    font-size: 1rem;
    color: var(--dark);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .logo span {
        font-size: 1rem;
    }

    .logo i {
        font-size: 1.5rem;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    [dir="rtl"] .tab-btn {
        border-left: none;
        border-right: 3px solid transparent;
    }

    .tab-btn.active {
        border-left-color: var(--primary-color);
    }

    [dir="rtl"] .tab-btn.active {
        border-right-color: var(--primary-color);
    }

    .converter-options,
    .downloader-options {
        grid-template-columns: 1fr;
    }

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

    .main-content {
        padding: 1.5rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-area i {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .option-card i,
    .platform-card i {
        font-size: 2.5rem;
    }

    .option-card h3,
    .platform-card h3 {
        font-size: 1.1rem;
    }

    .btn-primary {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .ad-container,
    .footer {
        display: none;
    }
}
