/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #7209b7;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --sidebar-width: 280px;
    --background-color: #667eea;
    --footer-color: #5a67d8;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--background-color) 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100%;
    background: #0f172a;
    /* Modern Dark Navy/Black */
    color: #94a3b8;
    /* Slate 400 text */
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1e293b;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 1.5rem;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1e293b;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.sidebar-header .logo img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
}

.sidebar-header .logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-header .logo h1 {
    font-size: 1.4rem;
    color: #f8fafc;
    /* Slate 50 */
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header .logo h1 i {
    color: var(--primary-color);
}

.sidebar-header .logo p {
    font-size: 0.8rem;
    color: #64748b;
    /* Slate 500 */
    margin: 0;
}

.close-menu {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s;
    padding: 5px;
    border-radius: 50%;
}

.close-menu:hover {
    opacity: 1;
    background: #1e293b;
    color: #fff;
}

.nav-menu {
    padding: 1.5rem 1rem;
    flex: 1;
    overflow-y: auto;
    /* Hide Scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

/* Hide Scrollbar for Chrome/Safari/Opera */
.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: #1e293b;
    /* Darker Slate */
    color: #f8fafc;
    transform: translateX(5px);
}

.nav-item.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
    font-weight: 600;
    border: none;
}

.nav-item.active i {
    color: #fff;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem;
    transition: margin-left 0.3s ease;
    width: 100%;
}

.header {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    font-size: 1.8rem;
    color: var(--white);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.08);
}

.mobile-menu-btn:hover {
    background: var(--primary-color);
    color: #ffd700;
}

.header h2 {
    color: var(--primary-color);
    flex: 1;
    font-size: 1.7rem;
    font-weight: 700;
}

/* Content Sections */
.content-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.section-title {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-bg);
    color: var(--primary-color);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-title i {
    font-size: 1.1rem;
}

/* Input */
textarea {
    width: 100%;
    height: 200px;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.char-counter {
    text-align: right;
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Country Select */
.country-select-wrapper {
    position: relative;
}

.country-select,
.country-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--white);
    transition: all 0.3s ease;
    cursor: pointer;
}

.country-select:focus,
.country-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.country-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    display: none;
    position: absolute;
    width: 100%;
    background: var(--white);
    z-index: 100;
    box-shadow: var(--shadow);
}

.country-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.country-item:hover {
    background: var(--light-bg);
}

/* Voice Options */
.voice-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.voice-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.2rem;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 600;
}

.voice-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.voice-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.voice-option input {
    display: none;
}

.voice-option i {
    font-size: 1.2rem;
}

/* Preview Section */
.voice-preview-section {
    display: none;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: var(--border-radius);
}

.preview-title {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-text {
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    font-style: italic;
    border-left: 4px solid var(--primary-color);
}

.preview-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.preview-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.preview-btn:hover {
    background: #5a08a0;
    transform: translateY(-2px);
}

.preview-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Voice Controls Collapsible Section */
.voice-controls-section {
    overflow: hidden;
}

.voice-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-bg);
}

.voice-controls-header .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    flex: 1;
}

.voice-controls-toggle {
    background: var(--light-bg);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.voice-controls-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.voice-controls-toggle i {
    transition: transform 0.3s ease;
}

.voice-controls-section.collapsed .voice-controls-toggle i {
    transform: rotate(-90deg);
}

.voice-controls-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.3s ease;
    opacity: 1;
}

.voice-controls-section.collapsed .voice-controls-content {
    max-height: 0;
    opacity: 0;
}

.control-subtitle {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.voice-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .voice-controls-grid {
        grid-template-columns: 1fr;
    }
}


/* Sliders */
.slider-group {
    margin-bottom: 2rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

.slider-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    background: var(--light-bg);
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    border-radius: 5px;
    background: #ddd;
    /* Standard gray background */
    outline: none;
    min-width: 200px;
    /* Prevent accidental value change while scrolling page */
    touch-action: pan-y;
    cursor: pointer;
}

/* Mobile optimizations for sliders */
@media (max-width: 768px) {
    .slider-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .slider {
        width: 100%;
        min-width: 0;
        height: 15px;
        /* Larger touch target */
    }

    .slider-value {
        align-self: center;
        margin-bottom: 0.5rem;
    }
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--secondary-color);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Normal slider labels - standard color for all labels */
.slider-labels span {
    color: #666;
    /* Standard gray color for all labels */
}

/* Buttons */
.convert-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin: 1rem 0;
}

.convert-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(67, 97, 238, 0.3);
}

.convert-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.download-btn {
    background: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #5a08a0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(114, 9, 183, 0.3);
}

/* Output */
.output-section {
    display: none;
}

.audio-player {
    width: 100%;
    margin: 1rem 0;
    border-radius: var(--border-radius);
}

/* Articles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.article-card {
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.3s ease;
    background: var(--white);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.article-image {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2.5rem;
}

.article-content {
    padding: 1.5rem;
}

.article-title {
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    color: var(--text-color);
    line-height: 1.4;
}

.article-excerpt {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

.article-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-details p {
    margin-bottom: 0.8rem;
}

.expand-btn {
    background: var(--light-bg);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    margin: 0.5rem auto 0;
}

.expand-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.expand-btn i {
    transition: transform 0.3s ease;
}

.article-card.expanded .expand-btn {
    background: var(--primary-color);
    color: white;
}

.article-card.expanded .expand-btn i {
    transform: rotate(180deg);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--white);
    margin-top: 2rem;
    background: var(--footer-color);
    border-radius: var(--border-radius);
}

.footer-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 1.5rem 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-link {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--accent-color);
}

.copyright {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

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

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Voice Select Dropdown */
.voice-select-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.voice-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--white);
    transition: all 0.3s ease;
    cursor: pointer;
    flex: 1;
    /* Take remaining space */
}

.preview-voice-btn {
    width: 46px;
    height: 46px;
    border-radius: var(--border-radius);
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    /* Don't shrink */
}

.preview-voice-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.preview-voice-btn.playing {
    background: #ef4444;
    /* Red for stop */
}

.voice-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.voice-select option {
    padding: 0.5rem;
}

/* Voice Controls Grid - Side by Side Layout */
.voice-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.voice-control-item {
    min-width: 0;
    /* Prevents overflow */
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 85%;
        max-width: 300px;
    }

    .main-content {
        padding: 1rem;
    }

    .voice-options {
        grid-template-columns: 1fr;
    }

    .voice-controls-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .slider-container {
        flex-direction: column;
        gap: 1rem;
    }

    .slider {
        min-width: 100%;
    }

    .header h2 {
        font-size: 1.3rem;
    }

    .footer-title {
        font-size: 2rem;
    }

    .preview-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Better mobile styling for voice select section */
    .voice-select-group {
        flex-direction: column;
        gap: 1rem;
    }

    .voice-select {
        width: 100% !important;
        font-size: 1rem;
        padding: 1rem;
        min-height: 48px;
    }

    .preview-voice-btn {
        width: 100%;
        height: 52px;
        border-radius: var(--border-radius);
        font-size: 1.1rem;
    }

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

    .content-section {
        padding: 1.25rem;
    }
}

@media (min-width: 769px) {
    .sidebar {
        left: 0;
    }

    .main-content {
        margin-left: 280px;
        width: calc(100% - 280px);
    }

    .mobile-menu-btn,
    .close-menu {
        display: none;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }

    .slider-value {
        min-width: 40px;
        font-size: 1rem;
    }

    .mobile-menu-btn {
        width: 40px;
        height: 40px;
    }

    .footer-title {
        font-size: 1.8rem;
    }

    .header h2 {
        font-size: 1.1rem;
    }

    /* Extra small screen improvements */
    .voice-select {
        font-size: 0.95rem;
    }

    .convert-btn {
        font-size: 1rem;
        padding: 1rem;
    }
}

@media (min-width: 769px) {
    .sidebar {
        left: 0;
    }

    .main-content {
        margin-left: 280px;
        width: calc(100% - 280px);
    }

    .mobile-menu-btn,
    .close-menu {
        display: none;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }

    .slider-value {
        min-width: 40px;
        font-size: 1rem;
    }

    .mobile-menu-btn {
        width: 40px;
        height: 40px;
    }

    .footer-title {
        font-size: 1.8rem;
    }
}

/* ========================================
   HISTORY PAGE STYLES
   ======================================== */
/* History Container */
.history-container {
    min-height: 400px;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}

/* Mobile Responsive History Container */
@media (max-width: 768px) {
    .history-container {
        padding: 0.5rem;
        border-radius: 12px;
    }
}

/* History List Header */
.history-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.history-list-info h3 {
    margin: 0;
    font-size: 1.3rem;
}

.history-list-info p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

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

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile Responsive Header */
@media (max-width: 768px) {
    .history-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .refresh-btn {
        width: 100%;
        justify-content: center;
    }
}

.history-item {
    background: var(--white);
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.history-text-preview {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.5;
    word-break: break-word;
}

.history-time {
    font-size: 0.85rem;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

.history-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.history-detail {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #666;
}

.history-detail i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

.history-item-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.history-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    text-decoration: none;
}

.play-btn {
    background: var(--primary-color);
    color: white;
}

.play-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67, 97, 238, 0.3);
}

.download-btn {
    background: var(--accent-color);
    color: white;
}

.download-btn:hover {
    background: #5a08a0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(114, 9, 183, 0.3);
}

/* Mobile Responsive History Items */
@media (max-width: 768px) {
    .history-item {
        padding: 1rem;
    }

    .history-item-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .history-time {
        font-size: 0.8rem;
        align-self: flex-start;
        background: #f1f5f9;
        padding: 0.2rem 0.6rem;
        border-radius: 12px;
    }

    .history-item-details {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .history-detail {
        width: 100%;
    }

    .history-item-actions {
        width: 100%;
        flex-direction: column;
    }

    .history-btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem;
    }

    /* Fix play button hover effect on mobile - prevent overflow */
    .play-btn:hover {
        transform: none;
    }

    .preview-voice-btn:hover {
        transform: none;
    }

    /* Increase page width on mobile by reducing padding significantly */
    .main-content {
        padding: 0.5rem;
        width: 100%;
    }

    .history-item {
        margin-left: 0;
        margin-right: 0;
        border-radius: 8px;
    }

    /* Reduce content section padding on mobile */
    .content-section {
        padding: 0.5rem;
    }
}

/* Responsive adjustments for history */
@media (max-width: 768px) {
    .history-item-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .history-time {
        align-self: flex-start;
    }

    .history-item-details {
        flex-direction: column;
        gap: 0.5rem;
    }

    .history-item-actions {
        width: 100%;
    }

    .history-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ========================================
   DAILY USAGE LIMIT STYLES
   ======================================== */

.daily-limit-container {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.daily-limit-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.daily-limit-text {
    color: #495057;
    font-weight: 500;
}

.daily-limit-text i {
    color: #4361ee;
    margin-right: 0.5rem;
}

.daily-limit-remaining {
    color: #28a745;
    font-weight: 600;
}

.daily-limit-bar {
    width: 100%;
    height: 20px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.daily-limit-progress {
    height: 100%;
    background: linear-gradient(90deg, #4361ee 0%, #7209b7 100%);
    transition: width 0.5s ease, background 0.3s ease;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 2px 6px rgba(67, 97, 238, 0.4);
}

/* Progress bar color changes based on usage */
.daily-limit-progress[data-usage="high"] {
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
}

.daily-limit-progress[data-usage="critical"] {
    background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .daily-limit-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .daily-limit-text,
    .daily-limit-remaining {
        font-size: 0.85rem;
    }
}

/* About Page Overrides */
.feature-card {
    text-align: center !important;
}

.feature-icon {
    margin: 0 auto 1rem auto !important;
}