/* Custom Styles for AM TTS */

:root {
    --primary-color: #667eea;
    --primary-dark-color: #5a6fd6;
    --background-light: #f8fafc;
    --background-dark: #1e293b; /* Brighter dark background */
    --text-light: #1e293b;
    --text-dark: #f8fafc;
    --glass-bg-light: rgba(255, 255, 255, 0.85);
    --glass-bg-dark: rgba(40, 51, 69, 0.85); /* Brighter glass background */
    --glass-border-light: rgba(255, 255, 255, 0.5);
    --glass-border-dark: rgba(255, 255, 255, 0.1);
}

html.dark {
    --background-light: var(--background-dark);
    --text-light: var(--text-dark);
    --glass-bg-light: var(--glass-bg-dark);
    --glass-border-light: var(--glass-border-dark);
}
body {
    background-color: var(--background-light);
    color: var(--text-light);
    transition: background-color 0.3s, color 0.3s;
}

/* Glass Effect Panel */
.glass-panel {
    background: var(--glass-bg-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border-light);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    transition: background-color 0.3s, border-color 0.3s;
}
html.dark .glass-panel {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
html.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
html.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Loading Animation */
.wave-bar {
    width: 4px;
    height: 20px;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 2px;
    animation: wave 1.2s infinite ease-in-out;
}
.wave-bar:nth-child(2) { animation-delay: -1.1s; }
.wave-bar:nth-child(3) { animation-delay: -1.0s; }
.wave-bar:nth-child(4) { animation-delay: -0.9s; }
.wave-bar:nth-child(5) { animation-delay: -0.8s; }
@keyframes wave {
    0%, 40%, 100% { transform: scaleY(0.4); }
    20% { transform: scaleY(1); }
}

/* Waveform Animation */
.waveform-bar {
    width: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: height 0.3s ease;
}

/* General Button Styles */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    background-color: #f1f5f9;
    transition: all 0.2s;
}
.action-btn:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}
html.dark .action-btn {
    background-color: #334155;
    color: #cbd5e1;
}
html.dark .action-btn:hover {
    background-color: #475569;
    color: #f1f5f9;
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.1);
    transition: all 0.2s;
}
.secondary-btn:hover {
    background-color: rgba(102, 126, 234, 0.2);
}
.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    background-color: var(--primary-color);
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.3);
    transition: all 0.2s;
}
.primary-btn:hover {
    background-color: var(--primary-dark-color);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px 0 rgba(102, 126, 234, 0.35);
}
.primary-btn:active {
    transform: scale(0.98);
}
.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.player-icon-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #64748b;
    transition: all 0.2s;
}
.player-icon-btn:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}
.player-icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: transparent;
    color: #64748b;
}
html.dark .player-icon-btn {
    color: #94a3b8;
}
html.dark .player-icon-btn:hover {
    color: #c7d2fe;
    background-color: rgba(102, 126, 234, 0.15);
}

.filter-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    background-color: transparent;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.filter-btn:hover {
    background-color: #f1f5f9;
}
.filter-btn.active {
    color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
}
html.dark .filter-btn {
    color: #cbd5e1;
}
html.dark .filter-btn:hover {
    background-color: #334155;
}
html.dark .filter-btn.active {
    color: #c7d2fe;
    background-color: rgba(102, 126, 234, 0.15);
    border-color: #c7d2fe;
}


/* Toast Animations */
.toast-show {
    animation: slideInRight 0.3s ease forwards;
}
.toast-hide {
    animation: slideOutRight 0.3s ease forwards;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Selection Colors */
::selection {
    background-color: rgba(102, 126, 234, 0.2);
    color: inherit;
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode text color adjustments */
html.dark .text-slate-800 { color: #e2e8f0; }
html.dark .text-slate-900 { color: #f8fafc; }
html.dark .text-slate-700 { color: #cbd5e1; }
html.dark .text-slate-600 { color: #94a3b8; }
html.dark .text-slate-500 { color: #94a3b8; }
html.dark .text-slate-400 { color: #64748b; }

html.dark .border-slate-200 { border-color: #334155; }
html.dark .border-slate-100 { border-color: #1e293b; }

html.dark .bg-slate-100 { background-color: #334155; }
html.dark .bg-slate-50\/50 { background-color: rgba(15, 23, 42, 0.5); }
html.dark .bg-white\/90 { background-color: rgba(15, 23, 42, 0.9); }
html.dark .bg-white\/50 { background-color: rgba(15, 23, 42, 0.5); }
html.dark .bg-white\/40 { background-color: rgba(15, 23, 42, 0.4); }
html.dark .bg-white { background-color: #1e293b; }

html.dark .text-primary { color: #a5b4fc; }
html.dark .bg-primary\/10 { background-color: rgba(165, 180, 252, 0.1); }

html.dark .accent-primary { accent-color: #a5b4fc; }
html.dark input[type="range"].accent-primary { background-color: #475569; }

html.dark .shadow-glass {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments for smaller buttons */
@media (max-width: 480px) {
    .action-btn, .secondary-btn, .primary-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    .action-btn span, .secondary-btn span, .primary-btn span {
        font-size: 18px !important;
    }
}

/* Footer Link */
.footer-link {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px rgba(102, 126, 234, 0);
}
.footer-link:hover {
    color: var(--primary-color);
    text-shadow: 0 0 16px rgba(102, 126, 234, 0.5);
}
html.dark .footer-link {
    color: var(--text-dark);
}
html.dark .footer-link:hover {
    color: #a5b4fc;
    text-shadow: 0 0 16px rgba(165, 180, 252, 0.5);
}
