/* Reset & Base - Ultra Minimalist */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0a0e1a 0%, #0f172a 50%, #1a1f35 100%);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #ffffff;
    line-height: 1.5;
}

/* Main Container - Full Screen Flex */
.ai-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    padding-bottom: 0.6rem;
    position: relative;
}

/* Minimal Header - Just Logo and Badge */
.minimal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
}

.logo-badge img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    scale: 1.16;
}

.logo-badge span {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: -0.2px;
}

.logo-badge span strong {
    color: #44E6DC;
    font-weight: 600;
}

.minimal-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff, #44E6DC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.minimal-header p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Free Tier Banner - Compact */
.free-tier-banner {
    background: rgba(68, 230, 220, 0.08);
    border: 1px solid rgba(68, 230, 220, 0.15);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    backdrop-filter: blur(8px);
}

.free-tier-banner i {
    color: #44E6DC;
    font-size: 0.9rem;
}

.free-tier-banner a {
    color: #44E6DC;
    font-weight: 500;
    text-decoration: none;
}

.free-tier-banner a:hover {
    text-decoration: underline;
}

/* Translator Grid - More Compact */
.translator-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
}

/* Translation Cards - Minimal Glass */
.translate-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    transition: all 0.2s ease;
}

.translate-card:focus-within {
    border-color: rgba(68, 230, 220, 0.3);
    box-shadow: 0 0 0 3px rgba(68, 230, 220, 0.1);
}

.card-header {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
}

.card-header span {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
}

select {
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

select option {
    background: #0f172a;
    color: white;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem 1.2rem;
    background: transparent;
    border: none;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

textarea::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

textarea:read-only {
    color: rgba(255, 255, 255, 0.8);
}

.char-count {
    padding: 0.5rem 1.2rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    float: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* File Upload Area */
.file-upload-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-input-label {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.5);
}

.file-input-label:hover {
    background: rgba(68, 230, 220, 0.1);
    border-color: rgba(68, 230, 220, 0.3);
    color: #44E6DC;
}

.file-input-label i {
    font-size: 0.7rem;
}

input[type="file"] {
    display: none;
}

.file-name {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Action Buttons inside card */
.card-actions {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.action-btn:hover {
    background: rgba(68, 230, 220, 0.1);
    border-color: rgba(68, 230, 220, 0.3);
    color: #44E6DC;
}

.download-btn {
    background: rgba(68, 230, 220, 0.08);
    border-color: rgba(68, 230, 220, 0.2);
}

.download-btn:hover {
    background: rgba(68, 230, 220, 0.15);
}

/* Swap Button - Minimal */
.swap-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(68, 230, 220, 0.1);
    border: 1px solid rgba(68, 230, 220, 0.2);
    color: #44E6DC;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.swap-btn:hover {
    background: rgba(68, 230, 220, 0.2);
}

/* Custom Scrollbar Styles - Elegant Minimalist */
textarea::-webkit-scrollbar {
    width: 10px;
}

textarea::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin: 10px 0;
}

textarea::-webkit-scrollbar-thumb {
    background: rgba(68, 230, 220, 0.3);
    border-radius: 10px;
    transition: all 0.2s ease;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(68, 230, 220, 0.8);
}

textarea::-webkit-scrollbar-thumb:active {
    background: rgba(68, 230, 220, 0.3);
}

/* Firefox */
textarea {
    scrollbar-width: auto;
    scrollbar-color: rgba(68, 230, 220, 0.4) rgba(255, 255, 255, 0.03);
}

/* Smooth scrolling */
textarea {
    scroll-behavior: smooth;
}

/* Main Translate Button - Minimal but Prominent */
.translate-btn-wrapper {
    text-align: center;
    margin-top: 1.5rem;
}

.translate-main-btn {
    background: linear-gradient(135deg, #44E6DC, #6B94E1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    color: #0a0e1a;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.2px;
    position: relative;
    overflow: hidden;
}

.translate-main-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.translate-main-btn:hover::before {
    left: 100%;
}

.translate-main-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.translate-main-btn:disabled {
    opacity: 0.5;
    transform: none;
    cursor: not-allowed;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #0a0e1a;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer Links - Minimal */
.minimal-footer {
    margin-top: 1.6rem;
    display: flex;
    gap: 1.5rem;
    font-size: 0.7rem;
}

.minimal-footer a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s ease;
}

.minimal-footer a:hover {
    color: #44E6DC;
}

/* Floating Back Link - Minimal */
.back-link {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.2s ease;
    z-index: 100;
}

.back-link:hover {
    background: rgba(68, 230, 220, 0.1);
    border-color: rgba(68, 230, 220, 0.3);
    color: #44E6DC;
}

/* Auth Modal - Minimal Dark */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(68, 230, 220, 0.2);
    border-radius: 24px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-content p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(68, 230, 220, 0.2);
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.form-group input:focus {
    outline: none;
    border-color: #44E6DC;
}

.modal-btn {
    width: 100%;
    padding: 0.85rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.modal-divider {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    margin: 1.5rem 0;
}

.modal-footer {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.modal-footer a {
    color: #44E6DC;
    text-decoration: none;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(68, 230, 220, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 850px) {
    .ai-container {
        justify-content: flex-start;
        padding: 1rem;
    }

    .translator-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .swap-wrapper {
        margin: 0.25rem 0;
    }

    .swap-btn {
        width: 40px;
        height: 40px;
    }

    textarea {
        min-height: 140px;
    }

    .minimal-header h1 {
        font-size: 1.5rem;
    }

    .back-link {
        bottom: 1rem;
        left: 1rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    textarea {
        min-height: 110px;
        font-size: 0.9rem;
        padding: 0.8rem;
    }

    .card-header {
        padding: 0.6rem 1rem;
    }

    .translate-main-btn {
        padding: 0.7rem 2rem;
        font-size: 0.85rem;
    }
    
    .file-name {
        max-width: 100px;
    }
}