/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

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

:root {
    /* Common Variables */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --transition-speed: 0.3s;
    --font-family: 'Poppins', sans-serif;
    
    /* Animation */
    --cubic-bezier: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background-color var(--transition-speed) ease;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    border: none;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.primary-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
}

.secondary-btn {
    font-size: 14px;
}

.control-btn {
    padding: 8px 12px;
    font-size: 13px;
}

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

/* Login Container Styles */
#login-container {
    max-width: 450px;
    margin: 0 auto;
    padding: 40px;
    border-radius: var(--border-radius-lg);
}

.login-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

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

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 600;
}

#login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.input-group {
    position: relative;
    width: 100%;
}

.input-group i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.input-group input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-family);
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.signup-text {
    margin-top: 20px;
    font-size: 14px;
}

.signup-text a {
    text-decoration: none;
    font-weight: 500;
}

/* Dashboard Container Styles */
#dashboard-container {
    max-width: 1280px;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.nav-links a.active {
    font-weight: 600;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-btn {
    padding: 8px 16px;
}

main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

main h2 {
    margin-bottom: 20px;
    font-weight: 600;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto 1fr;
    gap: 20px;
    height: calc(100vh - 160px);
}

.voice-selection-panel {
    grid-row: span 2;
    padding: 20px;
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.voice-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
}

.filter-group select {
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    outline: none;
    cursor: pointer;
}

.voice-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    flex: 1;
    overflow-y: auto;
}

.voice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-info h4 {
    font-size: 15px;
    font-weight: 500;
}

.voice-info span {
    font-size: 12px;
}

.play-sample {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.text-input-panel {
    padding: 20px;
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.text-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.character-counter {
    margin-left: auto;
    font-size: 13px;
}

#text-to-speech {
    width: 100%;
    height: 200px;
    padding: 15px;
    border-radius: var(--border-radius-sm);
    resize: none;
    font-family: var(--font-family);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.voice-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    margin-top: 10px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.setting-group label {
    font-size: 14px;
    font-weight: 500;
}

.setting-group input[type="range"] {
    width: 100%;
    cursor: pointer;
    margin: 5px 0;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-container span {
    min-width: 30px;
    text-align: right;
}

#generate-btn {
    margin-top: 15px;
}

.output-panel {
    padding: 20px;
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.audio-player {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.audio-waveform {
    width: 100%;
    height: 100px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.waveform-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0.7;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9IndhdmV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dodD0iMjAiIC8+CiAgICAgICAgPHJlY3QgeD0iOTEiIHk9IjQyIiB3aWR0aD0iMyIgaGVpZ2h0PSIxNSIgLz4KICAgICAgPC9nPgogICAgPC9wYXR0ZXJuPgogIDwvZGVmcz4KICA8cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI3dhdmVmb3JtKSIgLz4KPC9zdmc+');
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 5px;
}

.progress-bar {
    width: 100%;
    height: 5px;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    width: 20%;
    height: 100%;
    border-radius: 5px;
}

.time-display {
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

#download-btn {
    margin-top: 5px;
}

.generation-history {
    margin-top: 20px;
}

.generation-history h4 {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 500;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.history-info {
    display: flex;
    flex-direction: column;
}

.history-title {
    font-size: 14px;
    font-weight: 500;
}

.history-meta {
    font-size: 12px;
    opacity: 0.7;
}

.history-play {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Additional CSS for ElevenLabs Voice Panel */
.voice-info-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
}

.selected-voice {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.voice-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--accent-color);
}

.voice-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.voice-details h4 {
    font-size: 18px;
    margin: 0;
    color: var(--accent-color);
}

.voice-description {
    font-size: 13px;
    line-height: 1.4;
    margin-top: 5px;
    opacity: 0.9;
}

/* Dark theme adjustments */
.dark-theme .selected-voice,
.dark-theme .voice-settings {
    background: rgba(30, 30, 50, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* API Key Popup Styles */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup-content {
    width: 100%;
    max-width: 500px;
    padding: 30px;
    border-radius: var(--border-radius-lg);
    animation: popup-fade-in 0.3s ease;
}

.popup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.popup-form .input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.popup-form label {
    font-weight: 500;
}

.popup-form input {
    padding: 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.popup-form small {
    font-size: 12px;
    opacity: 0.7;
}

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

@keyframes popup-fade-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

#theme-switch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Voice Type Dropdown Styling */
.voice-filter-container {
    margin-bottom: 20px;
}

.voice-filter-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.voice-type-dropdown {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--text-color);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.light-theme .voice-type-dropdown {
    background-color: rgba(255, 255, 255, 0.5);
}

.dark-theme .voice-type-dropdown {
    background-color: rgba(30, 30, 50, 0.4);
}

.voice-type-dropdown:focus {
    outline: none;
    border-color: var(--accent-color);
}

.light-theme .voice-type-dropdown:focus {
    background-color: rgba(255, 255, 255, 0.8);
}

.dark-theme .voice-type-dropdown:focus {
    background-color: rgba(40, 40, 60, 0.7);
}

/* Voice Avatar and Details Styling */
.selected-voice {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.voice-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.voice-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.voice-details h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--accent-color);
}

.voice-details span {
    font-size: 14px;
    opacity: 0.8;
}

.voice-description {
    font-size: 13px;
    line-height: 1.4;
    margin-top: 5px;
    opacity: 0.9;
}

/* Voice Settings Styling */
.voice-settings {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    padding: 15px;
}

.setting-group {
    margin-bottom: 10px;
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
}

.logo-image {
    width: 180px;
    height: auto;
    transition: opacity 0.3s ease;
}

/* Theme-specific logo visibility */
.light-theme .logo-white {
    display: none;
}

.light-theme .logo-black {
    display: block;
}

.dark-theme .logo-white {
    display: block;
}

.dark-theme .logo-black {
    display: none;
}

/* Login container adjustments */
#login-container {
    max-width: 450px;
    margin: 0 auto;
    padding: 40px;
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.product-name {
    font-size: 35px;
    font-weight: 600;
    margin: 5px 0 2px 0;
    color: var(--text-color);
}