﻿/* Site-wide styles */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px;
    line-height: 60px;
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
}

/* Custom Color Palette - Softer, Modern Colors */
:root {
    --soft-blue: #5B9BD5;
    --soft-blue-dark: #4A7FB8;
    --soft-cyan: #70B8C9;
    --soft-cyan-dark: #5A9BAA;
    --soft-orange: #F2994A;
    --soft-orange-dark: #E67E22;
    --soft-green: #7BB68A;
    --soft-green-dark: #649B70;
    --soft-coral: #E89F8D;
    --soft-lavender: #B4A7D6;
}

/* ============================================
   TIGHTER, MORE POLISHED UI IMPROVEMENTS
   ============================================ */

/* Compact page header */
.page-header-compact {
    padding: 1rem 0 0.5rem;
    margin-bottom: 1rem;
}

    .page-header-compact h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .page-header-compact .lead {
        font-size: 1rem;
        margin-bottom: 0;
        line-height: 1.4;
    }

/* Tighter card spacing */
.card-compact {
    margin-bottom: 1rem;
}

    .card-compact .card-header {
        padding: 0.65rem 1rem;
        font-size: 0.95rem;
    }

    .card-compact .card-body {
        padding: 1rem;
    }

/* Form optimizations */
.form-control-compact {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
}

.form-label-compact {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Tighter form-check spacing */
.form-check-compact {
    margin-bottom: 0.4rem;
    padding-left: 1.75rem;
}

    .form-check-compact .form-check-input {
        margin-top: 0.2rem;
    }

    .form-check-compact .form-check-label {
        font-size: 0.9rem;
    }

/* Compact options panel */
#optionsPanel .card-body {
    padding: 0.85rem;
}

#optionsPanel .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

#optionsPanel .form-check {
    margin-bottom: 0.35rem;
}

/* Tighter instructions */
#instructions ol {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

    #instructions ol li {
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
    }

        #instructions ol li:last-child {
            margin-bottom: 0;
        }

#instructions p, #instructions ul {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

#instructions ul {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

    #instructions ul li {
        margin-bottom: 0.25rem;
    }

/* Compact sidebar */
.sidebar-compact .card {
    margin-bottom: 1rem;
}

.sidebar-compact .card-header {
    padding: 0.65rem 1rem;
}

.sidebar-compact .card-body {
    padding: 0.85rem;
}

.sidebar-compact .list-group-item {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
}

.sidebar-compact ul.small {
    font-size: 0.875rem;
}

    .sidebar-compact ul.small li {
        margin-bottom: 0.5rem;
    }

/* Tighter ad spacing */
.ad-container-compact {
    margin-bottom: 1rem;
}

/* Compact button group */
.btn-group-compact .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Translation results compact */
.translation-results-compact {
    padding: 0.75rem;
}

/* Responsive spacing adjustments */
@media (min-width: 992px) {
    /* Desktop gets slightly more breathing room */
    .page-header-compact {
        padding: 1.5rem 0 1rem;
        margin-bottom: 1.5rem;
    }

        .page-header-compact h1 {
            font-size: 2.25rem;
        }

        .page-header-compact .lead {
            font-size: 1.1rem;
        }
}

/* Utility classes for spacing control */
.mb-compact {
    margin-bottom: 0.75rem !important;
}

.mt-compact {
    margin-top: 0.75rem !important;
}

.p-compact {
    padding: 0.75rem !important;
}

.px-compact {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.py-compact {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

/* Existing styles continued below... */

/* Hero Section */
.hero-section {
    padding: 2rem 0 1rem;
}

    .hero-section h1 {
        color: #2c3e50;
        font-weight: 700;
    }

    .hero-section .lead {
        color: #6c757d;
        font-size: 1.1rem;
    }

/* Translation CTA Section */
.translation-cta-section {
    animation: fadeInUp 0.6s ease-out;
}

.bg-gradient {
    background: linear-gradient(135deg, var(--soft-blue) 0%, var(--soft-blue-dark) 100%);
}

.btn-xl {
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .btn-xl:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important;
    }

    .btn-xl i {
        flex-shrink: 0;
    }

    .btn-xl .d-inline-block {
        flex-grow: 1;
    }

/* Step Numbers */
.step-number {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--soft-blue) 0%, var(--soft-blue-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(91, 155, 213, 0.3);
}

/* Translation Output Display */
.translation-output {
    border-left: 4px solid var(--soft-blue);
}

/* Ad Container */
.ad-container {
    max-width: 100%;
    overflow: hidden;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--soft-blue) 0%, var(--soft-blue-dark) 100%);
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    color: white !important;
    font-weight: bold;
    font-size: 1.5rem;
}

.nav {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

    .nav a {
        color: white;
        text-decoration: none;
        transition: opacity 0.2s ease;
    }

        .nav a:hover {
            opacity: 0.85;
            text-decoration: underline;
        }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Bootstrap-like utilities */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.my-3 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.my-4 {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.me-1 {
    margin-right: 0.25rem;
}

.me-2 {
    margin-right: 0.5rem;
}

.me-3 {
    margin-right: 1rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 1rem;
}

.p-4 {
    padding: 1.5rem;
}

.p-5 {
    padding: 3rem;
}

.py-3 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-4 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

.d-block {
    display: block;
}

.d-inline-block {
    display: inline-block;
}

.d-flex {
    display: flex;
}

.align-items-start {
    align-items: flex-start;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.flex-grow-1 {
    flex-grow: 1;
}

.text-start {
    text-align: left;
}

.text-muted {
    color: #6c757d !important;
}

.text-primary {
    color: var(--soft-blue) !important;
}

.text-info {
    color: var(--soft-cyan) !important;
}

.text-warning {
    color: var(--soft-orange) !important;
}

.text-success {
    color: var(--soft-green) !important;
}

.text-danger {
    color: #dc3545 !important;
}

.fw-bold {
    font-weight: 700;
}

.opacity-90 {
    opacity: 0.9;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.175);
}

.rounded {
    border-radius: 0.375rem;
}

.border-0 {
    border: 0 !important;
}

.sticky-top {
    position: sticky;
}

/* Cards */
.card {
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease;
    background-color: #ffffff;
}

    .card:hover {
        box-shadow: 0 4px 6px rgba(0,0,0,0.12);
    }

.card-header {
    padding: 0.75rem 1.25rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,.125);
    border-radius: 0.5rem 0.5rem 0 0;
}

.card-body {
    padding: 1.25rem;
}

.border-info {
    border-color: var(--soft-cyan) !important;
}

.border-warning {
    border-color: var(--soft-orange) !important;
}

.bg-info {
    background: linear-gradient(135deg, var(--soft-cyan) 0%, var(--soft-cyan-dark) 100%) !important;
    border-color: var(--soft-cyan-dark) !important;
    color: #fff !important;
}

.bg-warning {
    background: linear-gradient(135deg, var(--soft-orange) 0%, var(--soft-orange-dark) 100%) !important;
    border-color: var(--soft-orange-dark) !important;
    color: #fff !important;
}

    .bg-warning strong {
        color: #fff !important;
    }

.bg-light {
    background-color: #f8f9fa !important;
}

.text-white {
    color: #fff !important;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.5rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--soft-blue) 0%, var(--soft-blue-dark) 100%);
    border-color: var(--soft-blue-dark);
    box-shadow: 0 2px 4px rgba(91, 155, 213, 0.3);
}

    .btn-primary:hover {
        background: linear-gradient(135deg, var(--soft-blue-dark) 0%, #3D6A9A 100%);
        box-shadow: 0 4px 8px rgba(91, 155, 213, 0.4);
        color: #fff;
        text-decoration: none;
    }

.btn-info {
    color: #fff;
    background: linear-gradient(135deg, var(--soft-cyan) 0%, var(--soft-cyan-dark) 100%);
    border-color: var(--soft-cyan-dark);
    box-shadow: 0 2px 4px rgba(112, 184, 201, 0.3);
}

    .btn-info:hover {
        background: linear-gradient(135deg, var(--soft-cyan-dark) 0%, #4A8391 100%);
        box-shadow: 0 4px 8px rgba(112, 184, 201, 0.4);
        color: #fff;
        text-decoration: none;
    }

.btn-warning {
    color: #fff;
    background: linear-gradient(135deg, var(--soft-orange) 0%, var(--soft-orange-dark) 100%);
    border-color: var(--soft-orange-dark);
    box-shadow: 0 2px 4px rgba(242, 153, 74, 0.3);
}

    .btn-warning:hover {
        background: linear-gradient(135deg, var(--soft-orange-dark) 0%, #D35400 100%);
        box-shadow: 0 4px 8px rgba(242, 153, 74, 0.4);
        color: #fff;
        text-decoration: none;
    }

.btn-success {
    color: #fff;
    background: linear-gradient(135deg, var(--soft-green) 0%, var(--soft-green-dark) 100%);
    border-color: var(--soft-green-dark);
    box-shadow: 0 2px 4px rgba(123, 182, 138, 0.3);
}

    .btn-success:hover {
        background: linear-gradient(135deg, var(--soft-green-dark) 0%, #547F5C 100%);
        box-shadow: 0 4px 8px rgba(123, 182, 138, 0.4);
        color: #fff;
        text-decoration: none;
    }

.btn-outline-primary {
    color: var(--soft-blue);
    border-color: var(--soft-blue);
    background-color: transparent;
}

    .btn-outline-primary:hover {
        background-color: var(--soft-blue);
        border-color: var(--soft-blue);
        color: #fff;
    }

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
    background-color: transparent;
}

    .btn-outline-secondary:hover {
        background-color: #6c757d;
        border-color: #6c757d;
        color: #fff;
    }

/* Alert */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
}

.alert-info {
    color: #3A6B77;
    background-color: #E3F4F7;
    border-color: var(--soft-cyan);
}

/* List Group */
.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
}

.list-group-flush {
    border-radius: 0;
}

    .list-group-flush .list-group-item {
        border-width: 0 0 1px;
    }

        .list-group-flush .list-group-item:last-child {
            border-bottom-width: 0;
        }

.list-group-item {
    position: relative;
    display: block;
    padding: 0.75rem 1.25rem;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.125);
}

.list-group-item-action {
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .list-group-item-action:hover {
        background-color: #f8f9fa;
        color: var(--soft-blue);
    }

/* Responsive grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

    .g-3 > * {
        padding-right: calc(var(--bs-gutter-x) * 0.5);
        padding-left: calc(var(--bs-gutter-x) * 0.5);
        margin-top: var(--bs-gutter-y);
    }

.g-4 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

    .g-4 > * {
        padding-right: calc(var(--bs-gutter-x) * 0.5);
        padding-left: calc(var(--bs-gutter-x) * 0.5);
        margin-top: var(--bs-gutter-y);
    }

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    position: relative;
    padding-right: 15px;
    padding-left: 15px;
}

.col-md-5,
.col-md-6,
.col-md-7,
.col-lg-4,
.col-lg-8 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .col-md-5 {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
    }

    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-7 {
        flex: 0 0 58.333333%;
        max-width: 58.333333%;
    }

    .p-md-5 {
        padding: 3rem !important;
    }
}

@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
}

/* Images */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Translation page specific */
.translation-area {
    width: 100%;
    min-height: 200px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    font-family: monospace;
}

.results-area {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 0.5rem;
    margin-top: 20px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .btn-xl {
        font-size: 1rem;
        padding: 0.75rem 1rem !important;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1.25rem;
    }
}

/* ============================================
   MOBILE-FIRST RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Mobile: Hide sidebar ads completely, show only top ad */
@media (max-width: 991px) {
    /* Hide sidebar on mobile */
    .col-lg-4 .sticky-top {
        position: static !important;
    }

    /* Reduce ad space on mobile */
    .ad-placeholder {
        min-height: 150px;
        font-size: 14px;
    }

    /* Stack content vertically */
    .col-lg-8,
    .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Mobile: Touch-friendly buttons */
@media (max-width: 767px) {
    /* Larger, more touch-friendly buttons */
    .btn {
        min-height: 44px; /* Apple's recommended touch target size */
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .btn-lg {
        min-height: 56px;
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
    }

    .btn-sm {
        min-height: 38px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9375rem;
    }

    /* Main translate button - extra prominent on mobile */
    #btnTranslate {
        font-size: 1.25rem !important;
        padding: 1.25rem 1rem !important;
        font-weight: 600 !important;
    }

    /* Radio buttons and checkboxes - larger touch targets */
    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
        margin-top: 0.125rem;
    }

    .form-check-label {
        padding-left: 0.5rem;
        font-size: 0.9375rem;
        line-height: 1.6;
    }

    /* Textarea - better mobile sizing */
    #txtEnglish {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        min-height: 150px;
    }

    /* Reduce padding on cards for mobile */
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    /* Compact options panel on mobile */
    #optionsPanel .row {
        margin: 0;
    }

    #optionsPanel .col-md-6 {
        padding: 0.5rem;
    }

    /* Smaller headings on mobile */
    h1.display-6 {
        font-size: 1.75rem !important;
    }

    h2.h5 {
        font-size: 1.125rem !important;
    }

    h3.h6 {
        font-size: 1rem !important;
    }

    .lead {
        font-size: 1rem !important;
    }

    /* Reduce icon sizes on mobile */
    .fa-lg {
        font-size: 1.25rem !important;
    }

    /* Compact step numbers */
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1.125rem;
    }

    /* Better spacing for instructions */
    #instructions ol li {
        margin-bottom: 1rem !important;
    }

        #instructions ol li p {
            font-size: 0.9375rem;
        }

    /* Compact translation results on mobile */
    .translation-output {
        border-left-width: 3px;
    }

    /* Hide "Advertisement" text on mobile to save space */
    .ad-container small.text-muted {
        display: none;
    }
}

/* Mobile: Landscape orientation optimizations */
@media (max-width: 767px) and (orientation: landscape) {
    /* Reduce vertical spacing in landscape */
    .mb-4 {
        margin-bottom: 1rem !important;
    }

    .mb-3 {
        margin-bottom: 0.75rem !important;
    }

    /* Compact header */
    h1.display-6 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .lead {
        font-size: 0.9375rem !important;
    }
}

/* Tablet optimizations (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    /* Two-column layout for options on tablet */
    #optionsPanel .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Slightly smaller ads on tablet */
    .ad-placeholder {
        min-height: 200px;
    }

    /* Keep sidebar visible but not sticky on tablet */
    .sticky-top {
        position: static !important;
    }
}

/* Small phones (max-width: 375px) */
@media (max-width: 375px) {
    .container {
        padding: 0 10px;
    }

    .card-body {
        padding: 0.75rem;
    }

    h1.display-6 {
        font-size: 1.5rem !important;
    }

    .btn-lg {
        font-size: 1rem !important;
    }

    /* Stack form options vertically on very small screens */
    #optionsPanel .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Print styles */
@media print {
    .ad-container,
    .ad-placeholder,
    .btn,
    #optionsPanel,
    .card-header button,
    .sticky-top,
    .navbar {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background-color: white;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ad placeholder for development */
.ad-placeholder {
    background-color: #f0f0f0;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-family: Arial, sans-serif;
    min-height: 250px;
    margin: 10px 0;
}

    .ad-placeholder::before {
        content: "📢 Ad Space (Development Mode)";
        font-size: 16px;
    }

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    .btn,
    .list-group-item-action,
    .form-check-input {
        cursor: pointer;
    }

        /* Remove hover effects that don't work on touch */
        .btn:hover {
            transform: none;
        }

        /* Add active states for touch feedback */
        .btn:active {
            transform: scale(0.98);
        }

        .list-group-item-action:active {
            background-color: #e9ecef;
        }
}

/* Fix for card header text and button visibility */
.card-header.bg-gradient h2,
.card-header.bg-success h2 {
    color: #ffffff !important;
}

.card-header.bg-gradient h2,
.card-header.bg-success h2 {
    color: #ffffff !important;
}

/* Fix for collapse button icon visibility in colored headers */
.card-header.bg-gradient .btn-light,
.card-header.bg-success .btn-light {
    color: #212529 !important;
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
}

.card-header.bg-gradient .btn-light:hover,
.card-header.bg-success .btn-light:hover {
    color: #212529 !important;
    background-color: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 1);
}

.card-header.bg-gradient .btn-light:focus,
.card-header.bg-gradient .btn-light:active,
.card-header.bg-gradient .btn-light.active,
.card-header.bg-success .btn-light:focus,
.card-header.bg-success .btn-light:active,
.card-header.bg-success .btn-light.active {
    color: #212529 !important;
    background-color: rgba(255, 255, 255, 1) !important;
    border-color: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.5) !important;
}

.card-header.bg-gradient .btn-light .fa,
.card-header.bg-success .btn-light .fa {
    color: #212529 !important;
}

/* Ensure button text stays dark in all states */
.card-header .btn-light,
.card-header .btn-light:hover,
.card-header .btn-light:focus,
.card-header .btn-light:active,
.card-header .btn-light.active {
    color: #212529 !important;
}

/* Force black text color for translation input header */
#translationInput .card-header h2,
#translationInput .card-header h2 span,
#translationInput .card-header h2 i {
    color: #000000 !important;
}

/* Keep collapse button icon dark and visible */
#translationInput .card-header .btn-light,
#translationInput .card-header .btn-light:hover,
#translationInput .card-header .btn-light:focus,
#translationInput .card-header .btn-light:active,
#translationInput .card-header .btn-light.active {
    color: #212529 !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
}

#translationInput .card-header .btn-light .fa {
    color: #212529 !important;
}

.card-header.bg-gradient h2[style*="color: black"] {
    color: black !important;
}
/* Footer text - responsive for small screens */
.footer-text {
    font-size: 0.85rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 576px) {
    .footer-text {
        font-size: 0.875rem;
        white-space: normal;
    }
}

@media (min-width: 768px) {
    .footer-text {
        font-size: 1rem;
    }
}

