/* Styles généraux */
:root {
    --primary-color: #0077b6;
    --secondary-color: #0096c7;
    --gradient-start: #0077b6;
    --gradient-end: #0096c7;
    --text-color: #1c1e21;
    --background-color: #f8f9fa;
    --white: #ffffff;
    --error-color: #dc3545;
    --success-color: #28a745;
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --border-radius: 12px;
    --spacing: 1rem;
}

/* Support pour les langues RTL */
html[lang="ar"] {
    direction: rtl;
}

html[lang="ar"] .menu li {
    margin-right: 0;
    margin-left: 1.5rem;
}

html[lang="ar"] .feature-icon {
    margin-right: 0;
    margin-left: 1rem;
}

/* Styles pour les polices spécifiques aux langues */
html[lang="zh"] body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

html[lang="hi"] body {
    font-family: 'Noto Sans Devanagari', Arial, sans-serif;
}

html[lang="ar"] body {
    font-family: 'Noto Sans Arabic', 'Tahoma', sans-serif;
}

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--text-color);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem var(--spacing);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 1.5rem 1.5rem;
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h1 i {
    margin-right: 0.5rem;
    font-size: 2.5rem;
}

.subtitle {
    color: #666;
    font-size: 1.2rem;
    font-weight: 400;
}

.downloader-box {
    max-width: 800px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    background: var(--white);
    padding: 2.5rem 1.5rem;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.downloader-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1.1rem;
}

input[type="url"] {
    width: 100%;
    padding: 1.25rem 1.25rem 1.25rem 3rem;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

input[type="url"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 119, 182, 0.1);
}

.download-btn {
    width: 100%;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    color: var(--white);
    padding: 1.25rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 119, 182, 0.2);
}

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

.download-btn:disabled {
    background: #e9ecef;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.result-container {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    display: none;
    animation: fadeIn 0.3s ease;
}

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

.result-container.error {
    display: block;
    background-color: #fff5f5;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.result-container.success {
    display: block;
    background-color: #f0fff4;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.video-info {
    margin-top: 20px;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 2.2rem;
    flex-wrap: wrap;
}

.video-info img {
    max-width: 200px;
    width: 200px;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    box-shadow: 0 2px 12px rgba(0,119,182,0.07);
}

.video-info-details {
    flex: 1 1 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.7rem;
    min-width: 0;
}

.video-info h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #0077b6;
    line-height: 1.25;
    max-width: 100%;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-meta {
    color: #65676b;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 20px;
    width: 100%;
}

.download-option {
    width: 100%;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #e0e6ed;
    background: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-size: 0.97rem;
    padding: 10px 0 10px 0;
    min-height: 44px;
}

.download-option:last-child {
    border-bottom: none;
}

.download-option .quality-badge,
.download-option .format-info,
.download-option .download-btn {
    margin: 0;
}

.download-option .quality-badge {
    min-width: 62px;
    text-align: center;
    font-size: 0.97rem;
}

.download-option .format-info {
    min-width: 70px;
    font-size: 0.97rem;
    color: #0096c7;
}

.download-option .download-btn {
    margin-left: auto;
    font-size: 0.89rem;
    padding: 0.22rem 0.58rem;
    min-width: 62px;
    width: 200px;
    border-radius: 4px;
    background: #0096c7;
    color: #fff;
    border: none;
    box-shadow: none;
    transition: background 0.13s;
}

@media (max-width: 600px) {
    .download-option .download-btn {
        min-width: 100%;
        width: 100%;
        margin-top: 0.4rem;
        font-size: 0.97rem;
        padding: 0.38rem 0;
    }
}

.instructions {
    margin-top: 2.5rem;
    padding: 0 1.5rem;
}

.instructions h3 {
    margin-bottom: 1.25rem;
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.instructions ol {
    padding-left: 1.75rem;
}

.instructions li {
    margin-bottom: 0.75rem;
    color: #495057;
    font-size: 1.1rem;
}

.faq-section {
    margin-top: 2.5rem;
    padding: 0 1.5rem;
}

footer {
    margin-top: auto;
    padding: 2rem 0;
    text-align: center;
    color: #495057;
}

footer p {
    margin: 0.75rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.main-footer {
    margin-top: 3rem;
    padding: 2.3rem 1.5rem 1.2rem 1.5rem;
    background: #f7fcff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -2px 12px rgba(0,119,182,0.04);
    text-align: center;
}

.footer-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 2.2rem;
    justify-content: center;
    list-style: none;
    margin: 0 0 1.2rem 0;
    padding: 0;
}

.footer-menu li {
    display: inline-block;
}

.footer-menu a {
    color: #0077b6;
    font-weight: 500;
    text-decoration: none;
    font-size: 1.09rem;
    padding: 0.2rem 0.7rem;
    border-radius: 5px;
    transition: background 0.16s, color 0.16s;
}

.footer-menu a:hover {
    background: #e0f4fa;
    color: #0096c7;
}

.footer-copy {
    color: #6c757d;
    font-size: 0.98rem;
    margin-top: 0.7rem;
}

@media (max-width: 600px) {
    .video-info {
        flex-direction: column;
        gap: 1.2rem;
    }
    .video-info img {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 10px;
    }
    .video-info-details {
        align-items: center;
        text-align: center;
    }
    .main-footer {
        padding: 1.2rem 0 0.7rem 0;
        border-radius: 0 0 8px 8px;
    }
    .footer-menu {
        gap: 1rem;
        font-size: 0.97rem;
    }
    .download-options {
        gap: 0;
    }
    .download-option {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        font-size: 0.96rem;
        padding: 10px 0 10px 0;
    }
    .video-info-details h2 {
        font-size: 1rem;
        white-space: normal;
    }
}

/* HEADER (NAV) STYLES */
.main-header {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background: #fff;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    box-shadow: 0 2px 16px rgba(0,119,182,0.06);
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
}

.header-logo-img {
    height: 40px;
    width: auto;
}

/* Style pour les écrans mobiles */
@media (max-width: 768px) {
    .header-logo-img {
        height: 32px;
    }
}

.menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.menu li {
    position: relative;
}

.menu a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.08rem;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    transition: background 0.18s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.menu a:hover {
    background: #f0f4fa;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 2.2rem;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0,119,182,0.08);
    border-radius: 8px;
    min-width: 140px;
    z-index: 100;
    padding: 0.3rem 0;
}

.dropdown-content li {
    width: 100%;
}

.dropdown-content a {
    width: 100%;
    padding: 0.6rem 1.1rem;
    font-size: 1rem;
    border-radius: 0;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    display: block;
}

.burger {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--primary-color);
    cursor: pointer;
    margin-left: 1rem;
    z-index: 110;
}

@media (max-width: 600px) {
    .main-header {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        padding: 0.7rem 0.5rem;
    }
    .logo {
        font-size: 1.1rem;
    }
    .logo-text {
        font-size: 1.05rem;
    }
    .menu {
        position: absolute;
        top: 100%;
        right: 0;
        background: #fff;
        box-shadow: 0 8px 32px rgba(0,119,182,0.08);
        border-radius: 0 0 10px 10px;
        flex-direction: column;
        gap: 0;
        min-width: 170px;
        width: max-content;
        display: none;
        padding: 0.5rem 0;
        z-index: 100;
    }
    .menu.open {
        display: flex;
    }
    .burger {
        display: block;
    }
    .dropdown-content {
        position: static;
        box-shadow: none;
        border-radius: 0;
        min-width: 0;
        padding: 0;
        background: transparent;
    }
    .dropdown-content a {
        padding-left: 2rem;
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    header {
        margin-bottom: 2rem;
        padding-top: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h1 i {
        font-size: 1.8rem;
    }

    .downloader-box {
        padding: 1.5rem;
    }

    .download-btn {
        padding: 1rem;
    }

    .instructions h3 {
        font-size: 1.2rem;
    }

    .instructions li {
        font-size: 1rem;
    }
}

.modern-steps {
    counter-reset: step;
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.5rem;
}

.modern-steps li {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
    font-size: 1.13rem;
    color: #222e3a;
    background: #f7fcff;
    border-radius: 8px;
    padding: 0.85rem 1.1rem;
    box-shadow: 0 2px 8px rgba(0,119,182,0.05);
    position: relative;
    transition: box-shadow 0.2s;
}

.modern-steps li:last-child {
    margin-bottom: 0;
}

.step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    min-width: 2.3rem;
    min-height: 2.3rem;
    background: linear-gradient(135deg, #0096c7 0%, #48cae4 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 1.35rem;
    margin-right: 1.1rem;
    box-shadow: 0 1px 4px rgba(0,119,182,0.08);
}

.modern-steps li b {
    color: #0077b6;
    font-weight: 700;
}

@media (max-width: 600px) {
    .modern-steps li {
        font-size: 1rem;
        padding: 0.7rem 0.7rem;
    }

    .step-icon {
        width: 2rem;
        height: 2rem;
        min-width: 2rem;
        min-height: 2rem;
        font-size: 1.1rem;
        margin-right: 0.7rem;
    }
}

.main-title {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-bottom: 0.7rem;
    justify-content: center;
}

.main-title-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0096c7 0%, #48cae4 100%);
    color: #fff;
    border-radius: 50%;
    width: 3.3rem;
    height: 3.3rem;
    font-size: 2.1rem;
    box-shadow: 0 2px 12px rgba(0,119,182,0.11);
}

.main-title-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.gradient-text {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.1;
    letter-spacing: -1px;
}

.main-title-sub {
    font-size: 1.1rem;
    color: #0096c7;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-top: 2px;
}

@media (max-width: 600px) {
    .main-title {
        gap: 0.7rem;
    }
    .main-title-icon {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 1.2rem;
    }
    .gradient-text {
        font-size: 1.2rem;
    }
    .main-title-sub {
        font-size: 0.97rem;
    }
}

.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.3rem 0 1.5rem 0;
    min-height: 48px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0f4fa;
    border-top: 4px solid #0096c7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.toast {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    background: #0096c7;
    color: #fff;
    padding: 1rem 2.2rem;
    border-radius: 8px;
    font-size: 1.05rem;
    box-shadow: 0 4px 24px rgba(0,119,182,0.13);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, bottom 0.3s;
}

.toast.show {
    display: block;
    opacity: 1;
    bottom: 60px;
    pointer-events: auto;
}

/* Animations et micro-interactions */
button, .download-btn, .menu a, .footer-menu a {
    transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.13s;
}

button:active, .download-btn:active {
    transform: scale(0.97);
}

.menu a:hover, .footer-menu a:hover {
    box-shadow: 0 2px 8px rgba(0,119,182,0.07);
    background: #e0f4fa;
}

.download-btn:hover {
    background: #0077b6;
}
