/* GPT Translate - Shared Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    letter-spacing: -1px;
}

.logo .gpt-highlight {
    background: linear-gradient(45deg, #00d4ff, #5a67d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
}

.stats-compact {
    display: flex;
    gap: 30px;
    align-items: center;
}

.stat-compact {
    text-align: center;
    color: white;
}

.stat-compact-number {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-compact-label {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Language Switcher Styles */
.language-switcher {
    position: relative;
    z-index: 1000;
}

.current-lang {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px 16px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: space-between;
}

.current-lang:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.current-lang .flag {
    font-size: 1.1rem;
}

.current-lang .chevron {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.current-lang[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 320px;
    overflow-y: auto;
    min-width: 200px;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #2d3748;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 4px 8px;
}

.lang-option:hover {
    background: rgba(66, 153, 225, 0.1);
    color: #4299e1;
}

.lang-option.active {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.lang-option .flag {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Custom scrollbar for language dropdown */
.lang-dropdown::-webkit-scrollbar {
    width: 6px;
}

.lang-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.lang-dropdown::-webkit-scrollbar-thumb {
    background: rgba(66, 153, 225, 0.3);
    border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(66, 153, 225, 0.5);
}

/* Language Suggestion Banner */
.lang-suggestion-banner {
    font-family: inherit;
}

.lang-suggestion-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.suggestion-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.suggestion-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.suggestion-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.suggestion-btn.primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.suggestion-btn.primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.suggestion-btn.secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.suggestion-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Mobile styles for language suggestion banner */
@media (max-width: 768px) {
    .lang-suggestion-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .suggestion-actions {
        width: 100%;
        justify-content: center;
    }
    
    .suggestion-btn {
        flex: 1;
        max-width: 140px;
    }
}

.main-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.15);
    margin-bottom: 40px;
    border: 1px solid rgba(255,255,255,0.2);
}

.translation-header {
    text-align: center;
    margin-bottom: 30px;
}

.translation-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.translation-subtitle {
    color: #718096;
    font-size: 1rem;
}

.translation-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: start;
    margin-bottom: 30px;
}

.input-section, .output-section {
    display: flex;
    flex-direction: column;
}

.language-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.language-select {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #4299e1;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234299e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
    transition: all 0.2s ease;
    background-color: rgba(66, 153, 225, 0.1);
}

.language-select:hover {
    background-color: rgba(66, 153, 225, 0.15);
}

.language-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

.detect-badge {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.swap-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
    align-self: flex-start;
    margin-top: 35px;
    position: relative;
    overflow: hidden;
}

.swap-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.swap-btn:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 10px 30px rgba(66, 153, 225, 0.5);
}

.swap-btn:hover::before {
    left: 100%;
}

.text-area {
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
    min-height: 300px;
    max-height: 600px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
    overflow-y: auto;
}

.text-area:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.output-area {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    color: #2d3748;
    font-weight: 500;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(66, 153, 225, 0.5);
}

.btn-secondary {
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

.btn-secondary:hover {
    background: #f7fafc;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.powered-by {
    text-align: center;
    margin: 30px 0;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.2);
}

.powered-by-text {
    color: white;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.gpt-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #00d4ff 0%, #5a67d8 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(15px);
    border-radius: 18px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 12px 35px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.2);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.1));
}

.feature-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #2d3748;
}

.feature-desc {
    color: #4a5568;
    line-height: 1.5;
    font-weight: 400;
    font-size: 0.9rem;
}

/* Content sections styling */
.content-section {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.15);
    margin-bottom: 40px;
    border: 1px solid rgba(255,255,255,0.2);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
}

.section-subtitle {
    font-size: 1.4rem;
    font-weight: 600;
    color: #4a5568;
    margin: 30px 0 15px 0;
}

.section-subheading {
    font-size: 1.2rem;
    font-weight: 600;
    color: #4a5568;
    margin: 25px 0 12px 0;
}

.section-content {
    color: #4a5568;
    line-height: 1.7;
    font-size: 1rem;
    margin-bottom: 15px;
}

.section-intro {
    color: #4a5568;
    line-height: 1.7;
    font-size: 1.1rem;
    margin-bottom: 40px;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Modern Steps Container */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.step-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border-radius: 20px 20px 0 0;
}

.step-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.step-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.step-number-modern {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.step-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
}

.step-description {
    color: #4a5568;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.step-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-tag {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    color: #234e52;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #81e6d9;
}

/* Pro Tips Section */
.quick-tips {
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid #9ae6b4;
    margin-top: 40px;
}

.tips-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #22543d;
    margin-bottom: 20px;
    text-align: center;
}

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

.tip-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 12px;
    color: #2d3748;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid rgba(154, 230, 180, 0.3);
}

.tip-item strong {
    color: #22543d;
}

.faq-item {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.faq-answer {
    color: #4a5568;
    line-height: 1.6;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px 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); }
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.toast {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    font-size: 1.1rem;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    /* Language switcher mobile styles */
    .language-switcher {
        order: -1; /* Move language switcher to top on mobile */
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .current-lang {
        min-width: 140px;
        font-size: 0.85rem;
    }

    .lang-dropdown {
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        right: auto;
        width: 90vw;
        max-width: 300px;
    }

    .lang-dropdown.show {
        transform: translateX(-50%) translateY(0);
    }

    .stats-compact {
        gap: 20px;
    }

    .translation-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .swap-btn {
        align-self: center;
        justify-self: center;
        transform: rotate(90deg);
        margin-top: 0;
    }
    
    .main-card, .content-section {
        padding: 25px 20px;
    }
    
    .logo {
        font-size: 1.8rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .section-subtitle {
        font-size: 1.2rem;
    }

    /* Mobile optimizations for step cards */
    .steps-container {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 30px;
    }

    .step-card {
        padding: 25px 20px;
    }

    .step-header {
        margin-bottom: 15px;
    }

    .step-icon {
        font-size: 2rem;
    }

    .step-number-modern {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .step-title {
        font-size: 1.2rem;
    }

    .tips-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tips-title {
        font-size: 1.2rem;
    }

    .quick-tips {
        padding: 20px;
        margin-top: 30px;
    }
}