/*------------------------------------*\
  #RESET & BASE
\*------------------------------------*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/*------------------------------------*\
  #LAYOUT
\*------------------------------------*/
.header {
    background: #333;
    color: white;
    padding: 15px 0;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: 70px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.main-content {
    margin-top: 100px;
    padding: 0 20px;
}


/*------------------------------------*\
  #COMPONENTS
\*------------------------------------*/
/* Navigation */
.header-nav {
    display: flex;
    gap: 20px;
}

.header-nav a {
    color: #ccc;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

/* Cards */
.feature-item {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

/*------------------------------------*\
  #UTILITIES
\*------------------------------------*/
.hidden {
    display: none;
}

.active {
    background-color: #4CAF50;
    color: white;
}

/*------------------------------------*\
  #ANIMATIONS
\*------------------------------------*/
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*------------------------------------*\
  #RESPONSIVE
\*------------------------------------*/

@media (min-width: 769px) and (max-width: 1024px) {

    /* Tablet styles */
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .features-section {
        margin-top: 90px;
        padding: 0 20px;
    }
}

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

.logo-section i {
    color: #4CAF50;
    font-size: 24px;
}

.logo-section h1 {
    color: white;
    margin: 0;
    font-size: 20px;
}

.header-nav a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.header-nav a.active {
    background-color: #4CAF50;
    color: white;
}

.converter-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.converter-title {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
    display: inline-block;
}

.controls-wrapper {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

#languageSelect {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background: white;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn i {
    font-size: 16px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary.active {
    background: #4CAF50;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

#output {
    width: 100%;
    min-height: 250px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    resize: vertical;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 20px;
}

.word-count {
    color: #666;
    font-size: 14px;
}

.history-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    display: flex;
    flex-direction: column;
}

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

.history-title {
    color: #333;
    font-size: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
    display: inline-block;
}

.history-controls {
    display: flex;
    gap: 10px;
}

.history-controls .btn {
    padding: 8px 15px;
    font-size: 14px;
}

#historyList {
    min-height: 250px;
    overflow-y: auto;
    padding-right: 10px;
}

#historyList:empty::before {
    content: 'No history available';
    display: block;
    text-align: center;
    color: #666;
    padding: 20px 0;
    font-style: italic;
}

.history-item,
.favorite-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    animation: slideIn 0.3s ease;
    border: 1px solid #eee;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.item-content {
    margin: 10px 0;
    word-break: break-word;
}

.no-items {
    text-align: center;
    padding: 30px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    animation: fadeIn 0.3s ease;
    z-index: 1000;
}

.history-item:hover {
    background: #f5f5f5;
    transform: translateX(5px);
    border-color: #ddd;
}

.history-text {
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.history-meta {
    color: #666;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .controls {
        gap: 8px;
    }


    button {
        padding: 12px 15px;
        min-width: 100px;
    }



    .feature-grid,
    .contact-grid,
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}


/* Footer Styling */
.footer {
    background: #333;
    color: white;
    padding: 60px 0 20px 0;
    margin-top: 40px;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-about p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #4CAF50;
}

.footer-contact p {
    color: #ccc;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-contact i {
    color: #4CAF50;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid #444;
    text-align: center;
}

.copyright {
    color: #999;
    font-size: 14px;
    text-align: center;
}

.copyright a {
    color: #4CAF50;
    text-decoration: none;
    transition: color 0.2s;
}

.copyright a:hover {
    color: #45a049;
    text-decoration: underline;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

/* Add these styles for the mobile menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #4CAF50;
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Loading Indicator */
.loading-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Status Messages */
.status-message {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.status-message.error {
    background: #ffebee;
    color: #c62828;
}

.status-message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-message.warning {
    background: #fff3e0;
    color: #ef6c00;
}

/* Focus States */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Better Form Validation */
input:invalid,
textarea:invalid {
    border-color: #c62828;
}

.form-group .error-message {
    color: #c62828;
    font-size: 14px;
    margin-top: 5px;
}

/* History visibility */
.history-list.hidden {
    display: none;
}

.history-list {
    transition: all 0.3s ease;
    max-height: 500px;
    overflow-y: auto;
}

/* Contact Page Styles */
.contact-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info {
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
}

.contact-info h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
    display: inline-block;
}

.contact-info p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 30px;
}

.contact-details {
    list-style: none;
    padding: 0;
}

.contact-details li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    color: #666;
}

.contact-details i {
    color: #4CAF50;
    font-size: 20px;
    width: 24px;
}

.contact-form {
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.contact-form h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.submit-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    transition: background-color 0.2s;
}

.submit-btn:hover {
    background-color: #43a047;
}

/* About Page Styles */
.about-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.about-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.about-card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
    display: inline-block;
}

.about-card p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Why Choose Us Section Styles */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 40px;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

/* Icon Styles */
.feature-item i {
    font-size: 32px;
    margin-bottom: 20px;
    display: inline-block;
    padding: 20px;
    border-radius: 50%;
    position: relative;
}

/* Unique Icon Colors */
.feature-item:nth-child(1) i {
    color: #2196F3;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.feature-item:nth-child(2) i {
    color: #FFC107;
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
}

.feature-item:nth-child(3) i {
    color: #9C27B0;
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
}

.feature-item:nth-child(4) i {
    color: #FF5722;
    background: linear-gradient(135deg, #fbe9e7 0%, #ffccbc 100%);
}

.feature-item:nth-child(5) i {
    color: #3F51B5;
    background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
}

.feature-item:nth-child(6) i {
    color: #4CAF50;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.feature-content {
    position: relative;
    z-index: 1;
}

.feature-content h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 600;
}

.feature-content p {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

/* Dark Mode Styles */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #fff;
    --card-bg: #2d2d2d;
    --border-color: #404040;
}

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-item {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.feature-item:nth-child(1) {
    animation-delay: 0.1s;
}

.feature-item:nth-child(2) {
    animation-delay: 0.2s;
}

.feature-item:nth-child(3) {
    animation-delay: 0.3s;
}

.feature-item:nth-child(4) {
    animation-delay: 0.4s;
}

.feature-item:nth-child(5) {
    animation-delay: 0.5s;
}

.feature-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* Accessibility Improvements */
.feature-item:focus-within {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .feature-item {
        animation: none;
        transition: none;
    }
}

/* Better Responsive Design */
@media (max-width: 480px) {
    .feature-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .feature-item i {
        margin-bottom: 15px;
    }
}

@media (min-width: 1200px) {
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Print Styles */
@media print {
    .feature-item {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
    }

    .feature-item i {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* Loading States */
.feature-grid.loading {
    position: relative;
    min-height: 200px;
}

.feature-grid.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Translator Page Styles */
.translator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 20px;
    margin: 20px 0;
    position: relative;
}

.translate-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.source-lang,
.target-lang {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.source-lang select,
.target-lang select {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    width: 100%;
    max-width: 100%;
}

.source-lang textarea,
.target-lang textarea {
    height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    width: 100%;
    font-size: 16px;
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .translator-grid {
        gap: 15px;
    }

    .source-lang textarea,
    .target-lang textarea {
        height: 180px;
    }

    .favorites-panel {
        width: 350px;
    }
}

/* Better Notifications */
.notification,
.error-message,
.copy-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    max-width: 90%;
    word-break: break-word;
}

/* Loading State */
.translator-section.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* Speech Controls */
.speech-controls {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    gap: 10px;
    z-index: 5;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: #e0e0e0;
}

.btn-icon.recording,
.btn-icon.speaking {
    background: #4CAF50;
    color: white;
}

/* Container width fix */
.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding-top: 20px;
    padding-bottom: 20px;
}

/* Page Sections Spacing */
.about-section,
.features-section,
.contact-section {
    max-width: 1200px;
    margin: 100px auto 50px;
    padding: 0 20px;
}

/* About Page */
.about-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

/* Features Page */
.feature-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.feature-card h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
    display: inline-block;
}

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

.feature-item {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-item i {
    color: #4CAF50;
    font-size: 32px;
    margin-bottom: 15px;
}

.feature-item h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 10px;
}

.feature-item p {
    color: #666;
    line-height: 1.6;
}



/* Contact Page */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.contact-info,
.contact-form {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}


/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {

    .about-section,
    .features-section,
    .contact-section {
        margin: 90px auto 40px;
        padding: 0 20px;
    }

    .contact-grid {
        gap: 30px;
    }
}

/* Features Page Styles */
.features-section {
    margin-top: 100px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.feature-item {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-item i {
    color: #4CAF50;
    font-size: 32px;
    margin-bottom: 15px;
    width: 64px;
    height: 64px;
    background: #f0f9f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-item h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 10px;
    margin-top: 15px;
}

.feature-item p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Feature page description */
.features-section>p {
    color: #666;
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .features-section {
        margin-top: 90px;
        padding: 0 20px;
    }
}

/* Translation History & Favorites Section */
.translations-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 40px 0;
}

.section-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #4CAF50;
    border-bottom: 2px solid #4CAF50;
    margin-bottom: -12px;
}

.tab-content {
    min-height: 200px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.history-list,
.favorites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.history-item,
.favorite-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    animation: slideIn 0.3s ease;
    border: 1px solid #eee;
}

.history-item:hover,
.favorite-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.translation-text {
    margin: 0;
    line-height: 1.4;
}

.translation-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.translation-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
/* New History Section Styles */
.translations-history {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.tab-buttons {
    display: flex;
    gap: 15px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 20px;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #4CAF50;
    color: white;
}

.tab-btn .history-count,
.tab-btn .favorites-count {
    font-size: 12px;
    color: #999;
}

.tab-btn.active .history-count,
.tab-btn.active .favorites-count {
    color: white;
}

.history-items,
.favorites-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.clear-all-btn {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.history-content {
    padding: 20px;
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
}

.item-content {
    margin: 10px 0;
    word-break: break-word;
}

.source-text {
    color: #333;
    margin-bottom: 5px;
}

.translated-text {
    color: #666;
    font-style: italic;
}

.item-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.action-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #eee;
    color: #4CAF50;
}

.action-btn i.favorite {
    color: #ffc107;
}

.no-items {
    text-align: center;
    color: #666;
    padding: 20px;
}

.history-items,
.favorites-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

/* Translator Page Additional Styles */
.char-count {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 12px;
    color: #666;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    animation: fadeInOut 2s ease;
}

.btn.active {
    background: #4CAF50;
    color: white;
}
/* Fix mobile menu styles */
@media (max-width: 768px) {

    .about-section,
    .features-section,
    .contact-section {
        margin: 80px auto 30px;
        padding: 0 15px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .about-card,
    .feature-card,
    .contact-info,
    .contact-form {
        padding: 20px;
    }

    .features-section {
        padding: 20px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .translator-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .source-lang,
    .target-lang {
        width: 100%;
    }

    .translate-controls {
        display: flex;
        justify-content: center;
        padding: 10px 0;
    }

    select {
        width: 100%;
        padding: 10px;
        margin-bottom: 10px;
    }

    textarea {
        width: 100%;
        min-height: 150px;
    }

    .button-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 10px;
    }

    /* Home page */
    .main-content {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .controls-wrapper {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* About page */
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Contact page */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .mobile-menu-btn {
        display: block;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #333;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .header-nav.active {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .header-nav a {
        color: white;
        padding: 12px 15px;
        text-align: center;
        border-radius: 4px;
        transition: background 0.3s;
    }

    .header-nav a:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    /* Animation for menu */
    .slide-in {
        animation: slideIn 0.3s ease-out;
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Header & Navigation */
    .header-content {
        justify-content: space-between;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* Features Section */
    .features-section {
        padding: 15px;
        margin-top: 90px;
    }

    /* Translator Section */
    .translator-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .source-lang,
    .target-lang {
        width: 100%;
    }

    /* History Section */
    .history-list,
    .favorites-list {
        grid-template-columns: 1fr;
    }

    .source-lang,
    .target-lang {
        width: 100%;
    }

    .translate-controls {
        display: flex;
        justify-content: center;
        padding: 10px 0;
    }

    .btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    .btn i {
        margin-right: 5px;
    }

    .footer {
        padding: 40px 0 20px 0;
    }


    #output,
    #historyList {
        min-height: 200px;
    }
}
