/* Wireframe Layout - Exact Implementation */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #000000 50%, #f4f4f4 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Banner Ad (ads 1) - Horizontal at top */
.top-banner-ad {
    width: 100%;
    height: 90px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 2px solid #e9ecef;
}

.top-banner-ad .ad-label {
    position: absolute;
    top: 5px;
    right: 10px;
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Main Layout - Sidebar + Content */
.main-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    flex: 1;
    margin-bottom: 20px;
}

/* Left Sidebar Ad (ads 2) - Vertical */
.left-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-ad {
    width: 100%;
    min-height: 300px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    position: sticky;
    top: 20px;
}

.sidebar-ad .ad-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Fallback ad content */
.fallback-ad {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ad-placeholder h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.ad-placeholder p {
    margin-bottom: 15px;
    opacity: 0.9;
}

.ad-cta {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ad-cta:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Main Content Area */
.main-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: #2c3e50;
}

/* Logo Container */
.logo-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: logoRotate 20s linear infinite;
}

@keyframes logoRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Logo Icon */
.logo-icon {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 2;
}

.logo-icon i {
    font-size: 1.8rem;
    color: white;
    z-index: 3;
    position: relative;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Sound Waves Animation */
.sound-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    pointer-events: none;
}

.wave {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: waveExpand 2s ease-out infinite;
}

.wave-1 {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    animation-delay: 0s;
}

.wave-2 {
    width: 80px;
    height: 80px;
    top: 0px;
    left: 0px;
    animation-delay: 0.5s;
}

.wave-3 {
    width: 100px;
    height: 100px;
    top: -10px;
    left: -10px;
    animation-delay: 1s;
}

@keyframes waveExpand {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Logo Text */
.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 2;
    position: relative;
}

.logo-brand {
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
}

.logo-name {
    font-size: 1.8rem;
    font-weight: 600;
    color: #ffd700;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    margin-top: -5px;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #2c3e50;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 1.2rem;
    color: #7f8c8d;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.1rem;
}

#textInput {
    width: 100%;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    transition: all 0.3s ease;
    background: #fafbfc;
}

#textInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.voice-selection,
.speed-control,
.stability-control,
.clarity-control {
    display: flex;
    flex-direction: column;
}

.voice-selection label,
.speed-control label,
.stability-control label,
.clarity-control label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #495057;
    font-size: 0.95rem;
}

#voiceSelect {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#voiceSelect:focus {
    outline: none;
    border-color: #667eea;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e1e5e9;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Output Section */
.output-section {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.audio-container h3 {
    margin-bottom: 15px;
    color: #495057;
    font-weight: 600;
}

.audio-container audio {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    min-width: 150px;
}

.download-btn {
    background: #28a745;
    color: white;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.regenerate-btn {
    background: #6c757d;
    color: white;
}

.regenerate-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

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

.loading p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Error State */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error i {
    font-size: 1.2rem;
    color: #dc3545;
}

/* Bottom Banner Ad (ads 3) - Horizontal at bottom */
.bottom-banner-ad {
    width: 100%;
    height: 90px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    position: relative;
}

.bottom-banner-ad .ad-label {
    position: absolute;
    top: 5px;
    right: 10px;
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Premium Upgrade Section */
.premium-upgrade {
    margin-top: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.premium-upgrade::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 15s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

.upgrade-content {
    position: relative;
    z-index: 2;
}

.upgrade-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.upgrade-content p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.upgrade-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.feature:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.feature i {
    color: #ffd700;
    font-size: 1.2rem;
}

.feature span {
    font-weight: 500;
    font-size: 0.95rem;
}

.upgrade-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 15px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.upgrade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.upgrade-btn:hover::before {
    left: 100%;
}

.upgrade-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.upgrade-btn i {
    color: #ffd700;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 20px;
    color: white;
    opacity: 0.8;
}

.footer p {
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .main-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .left-sidebar {
        order: -1;
    }

    .sidebar-ad {
        min-height: 150px;
        position: static;
    }

    .main-content {
        padding: 25px;
    }

    .logo {
        padding: 15px 25px;
        gap: 15px;
    }

    .logo-icon {
        width: 50px;
        height: 50px;
    }

    .logo-icon i {
        font-size: 1.5rem;
    }

    .logo-brand {
        font-size: 1.8rem;
    }

    .logo-name {
        font-size: 1.4rem;
    }

    .header h1 {
        font-size: 2rem;
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        min-width: auto;
    }

    .top-banner-ad,
    .bottom-banner-ad {
        height: 70px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .main-content {
        padding: 20px;
    }

    .controls {
        padding: 20px;
    }

    .generate-btn {
        padding: 15px;
        font-size: 1rem;
    }
}

/* Animation for smooth transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}