/* Custom CSS for Reddit Video Downloader */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: white;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: white;
}

/* Ensure all sections have proper background */
section {
    background-color: white !important;
    position: relative;
    z-index: 10;
}

section.bg-light {
    background-color: #f8f9fa !important;
}

section:not(.hero-section) {
    background-color: white !important;
    opacity: 1 !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (max-width: 768px) {
    .navbar-toggler {
        margin-left: auto;
        padding: 0.25rem 0.5rem;
    }
}

/* Ensure navbar brand and toggler are properly aligned */
.navbar-brand {
    flex-shrink: 0;
}

.navbar-nav.ms-auto {
    margin-left: auto !important;
}

/* Improve navbar layout on all devices */
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-collapse {
    flex-grow: 1;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(0, 123, 255, 0.95);
        border-radius: 8px;
        /*margin-top: 0.5rem;*/
        padding: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 6px;
        margin: 0.25rem 0;
    }
    
    .navbar-nav .nav-link:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding-top: 80px;
    padding-bottom: 2rem;
    min-height: auto;
    display: block;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
    isolation: isolate;
    margin-bottom: 0;
}

/* Ensure hero section doesn't bleed into other sections */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: white;
    z-index: 2;
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-section .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.download-form {
    background: rgba(255, 255, 255, 0.15);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 1rem 0;
    position: relative;
    z-index: 5;
}

.download-form .form-control {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    transition: all 0.3s ease;
    min-width: 0;
    width: 100%;
}

.download-form .form-control:focus {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    outline: none;
}

.download-form .form-control::placeholder {
    color: #6c757d;
    opacity: 0.8;
}

.download-form .btn {
    border-radius: 10px;
    padding: 1rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
    white-space: nowrap;
    /*min-width: 120px;*/
    width: 100%;
}

.download-form .btn:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

.download-form .form-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
    border-radius: 10px;
}

/* Features Section */
#features {
    background-color: #f8f9fa !important;
    position: relative;
    z-index: 20;
    opacity: 1 !important;
    margin-top: 0 !important;
    padding-top: 3rem !important;
}

.feature-card {
    /*background: white;*/
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    /*transition: transform 0.3s ease, box-shadow 0.3s ease;*/
    height: 100%;
    position: relative;
    z-index: 3;
}

.feature-card:hover {
    /*transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);*/
}

.feature-icon {
    color: var(--primary-color);
}

.feature-card h4 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--secondary-color);
    margin-bottom: 0;
}

/* Platform Cards */
#platforms {
    background-color: white !important;
    position: relative;
    z-index: 20;
    opacity: 1 !important;
    margin-top: 0 !important;
    padding-top: 3rem !important;
}

.platform-card {
    /*background: white;*/
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    /*transition: transform 0.3s ease, box-shadow 0.3s ease;*/
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    z-index: 3;
}

.platform-card:hover {
    /*transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);*/
}

.platform-icon {
    margin-bottom: 1rem;
}

.platform-card h4 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.platform-card p {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.platform-card .btn {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.platform-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.platform-card .btn.active {
    background-color: var(--success-color);
    border-color: var(--success-color);
    cursor: default;
}

.platform-card .btn.active:hover {
    transform: none;
    box-shadow: none;
}

/* How To Section */
.step-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    height: 100%;
}

.step-card:hover {
    transform: translateY(-3px);
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto;
}

.step-card h5 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.step-card p {
    color: var(--secondary-color);
    margin-bottom: 0;
}

/* FAQ Section */
.accordion-item {
    border: none;
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.accordion-button {
    background: white;
    border: none;
    font-weight: 600;
    color: var(--dark-color);
}

.accordion-button:not(.collapsed) {
    background: var(--primary-color);
    color: white;
}

.accordion-button:focus {
    box-shadow: none;
    border: none;
}

.accordion-body {
    background: #f8f9fa;
    color: var(--secondary-color);
}

/* Footer */
.footer-links a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color) !important;
}

/* Google Search Console Mobile Rendering Fix */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding-top: 100px;
        padding-bottom: 2rem;
        min-height: auto !important;
        height: auto !important;
        display: block !important;
    }
    
    .hero-section .row {
        min-height: auto !important;
        height: auto !important;
        display: block !important;
    }
    
    .hero-section .col-lg-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
        margin-top: 0;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .download-form {
        margin-top: 1.5rem;
        margin-left: 1rem;
        margin-right: 1rem;
        padding: 1.5rem;
    }
    
    .feature-card,
    .step-card {
        margin-bottom: 1rem;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .hero-image {
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-image img {
        max-width: 100%;
        height: auto;
        max-height: 300px;
    }
}

@media (max-width: 576px) {
    /*.navbar-brand {
        font-weight: bold;
        font-size: 1.3rem;
    }
    .navbar-brand img{
        width: 20px;
        height: 20px;
    }*/
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    .download-form {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 12px;
    }
    
    .download-form .input-group {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .download-form .form-control {
        border-radius: 8px;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 48px;
        width: 100%;
        flex: 1;
        margin-right: 0;
    }
    
    .download-form .btn {
        margin-top: 0.5rem;
        width: 100%;
        border-radius: 8px;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .form-text {
        margin-top: 0.75rem;
        font-size: 0.875rem;
        opacity: 0.8;
    }
}

/* Mobile-specific improvements */
@media (max-width: 480px) {
    .hero-section {
        padding-top: 80px;
        padding-bottom: 2rem;
        min-height: auto;
        height: auto;
    }
    
    .hero-section .row {
        margin-left: 0;
        margin-right: 0;
        min-height: auto;
    }
    
    .hero-section .col-lg-6 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .download-form {
        margin: 0.75rem;
        padding: 1.25rem;
    }
    
    .download-form .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-image {
        margin-top: 1.5rem;
    }
    
    .hero-image img {
        max-width: 100%;
        height: auto;
        max-height: 250px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .hero-section {
        padding-top: 80px;
        padding-bottom: 1.5rem;
        min-height: auto;
        height: auto;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .download-form {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .download-form .form-control {
        padding: 0.75rem 1rem;
        min-width: 0;
        width: 100%;
    }
    
    .download-form .btn {
        padding: 0.75rem 1.25rem;
        width: 100%;
    }
    
    .download-form .input-group {
        flex-direction: column;
    }
    
    .download-form .btn {
        margin-top: 1rem;
        width: 100%;
        border-radius: 10px !important;
    }
    
    .form-control {
        width: 100% !important;
        border-radius: 10px !important;
    }
    .download-form .input-group .form-control {
        margin-bottom: 0.5rem;
    }
    
    .hero-image {
        margin-top: 1rem;
    }
    
    .hero-image img {
        max-height: 200px;
    }
}

/* Animation Classes */
.fade-in {
    /*animation: fadeIn 0.6s ease-in;*/
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.3s ease;
}

/* Disable transitions on specific elements to prevent performance issues */
.navbar-toggler,
.form-control,
.btn {
    transition: all 0.2s ease;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: var(--success-color);
    color: white;
}

.alert-danger {
    background: var(--danger-color);
    color: white;
}

/* Custom Button Styles */
.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #0056b3);
    border: none;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #0056b3, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,123,255,0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }
    
    .form-control {
        min-height: 44px;
        font-size: 16px;
    }
    
    .download-form .btn {
        min-height: 48px;
    }
    
    .download-form .form-control {
        min-height: 48px;
    }
    
    /* 移动端特殊修复 */
    .hero-section {
        min-height: auto !important;
        height: auto !important;
        padding-bottom: 2rem;
        display: block !important;
    }
    
    .hero-section .row {
        min-height: auto !important;
        height: auto !important;
        display: block !important;
    }
    
    .hero-section .container {
        padding-top: 0;
        padding-bottom: 0;
    }
    
    .hero-section .col-lg-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        float: none !important;
    }
}

/* Force clean backgrounds for all content sections */
section:not(.hero-section) {
    background-color: white !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 20 !important;
    margin-top: 0 !important;
}

section.bg-light {
    background-color: #f8f9fa !important;
    opacity: 1 !important;
}

/* Google Search Console Specific Fixes */
@media screen and (max-width: 768px) {
    .hero-section {
        min-height: auto !important;
        height: auto !important;
        display: block !important;
        position: static !important;
        isolation: isolate !important;
    }
    
    .hero-section .row {
        min-height: auto !important;
        height: auto !important;
        display: block !important;
        margin: 0 !important;
    }
    
    .hero-section .col-lg-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        float: none !important;
        display: block !important;
        position: static !important;
    }
    
    .hero-section .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 15px !important;
    }
    
    /* Ensure content sections are clear */
    section:not(.hero-section) {
        background-color: white !important;
        position: relative !important;
        z-index: 20 !important;
        opacity: 1 !important;
        margin-top: 0 !important;
    }
    
    .bg-light {
        background-color: #f8f9fa !important;
        opacity: 1 !important;
    }
}

/* Form Validation Styles */
.form-control.is-invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220,53,69,0.25);
    background: rgba(255, 255, 255, 0.98);
}

.form-control.is-valid {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(40,167,69,0.25);
    background: rgba(255, 255, 255, 1);
}

/* Ensure form controls have consistent styling */
.form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Input focus improvements */
.download-form .form-control:focus {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

/* Mobile input improvements */
@media (max-width: 768px) {
    .download-form .form-control {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        width: 100%;
        min-width: 0;
    }
    
    .download-form .form-control:focus {
        transform: none;
    }
    
    .download-form .input-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.download-form .input-group > * {
    flex: 1;
    min-width: 0;
}

.download-form .input-group .form-control {
    flex: 1 1 auto;
    min-width: 200px;
}

.download-form .input-group .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Desktop specific styles */
@media (min-width: 768px) {
    .download-form .input-group {
        flex-direction: row;
    }
    
    .download-form .input-group .form-control {
        flex: 1;
        margin-right: 0.5rem;
    }
    
    .download-form .input-group .btn {
        flex: 0 0 auto;
    }
}
}

/* Language Switcher */
.dropdown-menu {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: none;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--light-color);
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #0056b3;
    transform: scale(1.1);
}

/* Print Styles */
@media print {
    .navbar,
    .scroll-to-top,
    .download-form {
        display: none !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
    }
    
    * {
        transition: none !important;
        animation: none !important;
    }
} 

.input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: calc(var(--bs-border-width) * -1);
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}
.nav-item a{
    color: #fff;
    font-size: 20px;
    font-weight: bold;
}