:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent-color: #ec4899;
    --accent-light: #f472b6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --info-color: #06b6d4;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --body-font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --heading-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font-family);
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--heading-font-family);
    font-weight: 600;
    color: var(--gray-800);
}

.display-4 {
    font-weight: 700;
    font-size: 2.5rem;
}

.text-gradient {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.navbar {
    padding: 0.5rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.container {
    flex: 1;
    padding: 0.5rem 0;
}

.modern-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-primary-soft {
    background-color: rgba(99, 102, 241, 0.1);
}

.bg-accent-soft {
    background-color: rgba(236, 72, 153, 0.1);
}

.bg-success-soft {
    background-color: rgba(16, 185, 129, 0.1);
}

.bg-info-soft {
    background-color: rgba(6, 182, 212, 0.1);
}

.btn-swap-modern {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--info-color), #0ea5e9);
    color: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(6, 182, 212, 0.3), 0 2px 4px -1px rgba(6, 182, 212, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.btn-swap-modern:hover {
    transform: rotate(180deg);
    background: linear-gradient(135deg, #0ea5e9, var(--info-color));
    box-shadow: 0 10px 15px -3px rgba(6, 182, 212, 0.3), 0 4px 6px -2px rgba(6, 182, 212, 0.2);
}

.modern-input {
    border: 1px solid var(--gray-300);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: white;
}

.modern-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.modern-input-group {
    border-radius: 0.75rem;
    overflow: hidden;
}

.modern-input-group .input-group-text {
    background-color: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-right: none;
}

.modern-input-group .form-control {
    border-left: none;
}

.modern-input-group .form-select {
    border-left: 1px solid var(--gray-300);
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

textarea#outputText {
    background-color: var(--gray-100);
    font-weight: 500;
}

.btn {
    border-radius: 0.75rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-primary-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3), 0 2px 4px -1px rgba(99, 102, 241, 0.2);
}

.btn-primary-modern:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3), 0 4px 6px -2px rgba(99, 102, 241, 0.2);
}

.btn-accent-modern {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(236, 72, 153, 0.3), 0 2px 4px -1px rgba(236, 72, 153, 0.2);
}

.btn-accent-modern:hover {
    background: linear-gradient(135deg, var(--accent-light), var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(236, 72, 153, 0.3), 0 4px 6px -2px rgba(236, 72, 153, 0.2);
}

.btn-warning-modern {
    background: linear-gradient(135deg, var(--warning-color), #fbbf24);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3), 0 2px 4px -1px rgba(245, 158, 11, 0.2);
}

.btn-warning-modern:hover {
    background: linear-gradient(135deg, #fbbf24, var(--warning-color));
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3), 0 4px 6px -2px rgba(245, 158, 11, 0.2);
}

.btn-secondary-modern {
    background: linear-gradient(135deg, var(--secondary-color), var(--gray-600));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(100, 116, 139, 0.3), 0 2px 4px -1px rgba(100, 116, 139, 0.2);
}

.btn-secondary-modern:hover {
    background: linear-gradient(135deg, var(--gray-600), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(100, 116, 139, 0.3), 0 4px 6px -2px rgba(100, 116, 139, 0.2);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.language-detected {
    font-size: 0.875rem;
}

#detectedLang {
    font-weight: 600;
    color: var(--primary-color);
}

#detectConfidence {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.feature-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.75rem;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.feature-icon i {
    font-size: 1.5rem;
}

.feature-card h5 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--gray-800);
}

.feature-card p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

#languageSelect {
    max-height: 200px;
    overflow-y: auto;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background-color: var(--gray-100);
}

.history-item:last-child {
    border-bottom: none;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.history-languages {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

.history-timestamp {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.history-texts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-text {
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.history-original {
    background-color: var(--gray-100);
}

.history-translated {
    background-color: rgba(99, 102, 241, 0.1);
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.history-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

#copyToast .toast-header {
    background-color: var(--success-color);
    color: white;
}

#copyToast .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.9rem;
    }

    .container {
        padding: 1rem 0.5rem;
    }

    .display-4 {
        font-size: 2rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .modern-card {
        margin-bottom: 1rem;
    }

    .d-flex.gap-3 {
        gap: 0.5rem !important;
    }

    .btn.flex-fill {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-icon {
        width: 48px;
        height: 48px;
    }

    .feature-icon i {
        font-size: 1.25rem;
    }

    .feature-card h5 {
        font-size: 1rem;
    }

    .feature-card p {
        font-size: 0.8rem;
    }

    textarea.form-control {
        min-height: 120px;
    }

    .icon-circle {
        width: 40px;
        height: 40px;
    }

    .icon-circle i {
        font-size: 1.2rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .brand-logo {
        width: 30px;
        height: 30px;
    }

    .card-header h5 {
        font-size: 1rem;
    }

    .language-detected {
        font-size: 0.8rem;
    }

    .modern-input {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .modern-input-group .input-group-text {
        padding: 0 0.6rem;
    }

    .modern-input-group .form-control {
        padding: 0.6rem 0.8rem;
    }

    .modern-input-group .form-select {
        padding: 0.6rem 0.8rem;
    }

    .btn-swap-modern {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .history-item {
        padding: 0.75rem;
    }

    .history-text {
        font-size: 0.8rem;
    }

    .history-btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding: 0.5rem;
    }

    .row.g-4 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }

    .col-lg-5,
    .col-lg-2 {
        margin-bottom: 0.5rem;
    }

    .col-lg-2 {
        display: flex;
        justify-content: center;
        margin: 1rem 0;
    }

    .card-body {
        padding: 0.75rem;
    }

    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .btn.flex-fill {
        font-size: 0.75rem;
        padding: 0.4rem;
    }

    textarea.form-control {
        min-height: 100px;
    }

    .d-flex.gap-3 {
        flex-wrap: wrap;
    }

    .d-flex.gap-3 .btn {
        flex: 1 1 calc(50% - 0.25rem);
        margin-bottom: 0.25rem;
    }

    .d-flex.gap-3 .btn:last-child {
        flex: 1 1 100%;
    }

    .btn-swap-modern {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}