* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header h1 i {
    margin-right: 10px;
}

/* Main layout */
main {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.main-content {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Advertisement banners */
.ad-container {
    background: linear-gradient(135deg, #f6f9fc 0%, #e6f0f5 100%);
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    padding: 15px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.ad-label {
    position: absolute;
    top: -10px;
    left: 10px;
    background: #ff6b6b;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.ad-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ad-content i {
    font-size: 24px;
    color: #4a5568;
}

.ad-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s;
}

.ad-button:hover {
    transform: scale(1.05);
}

.ad-button-small {
    background: #48bb78;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
}

/* Side banners */
.side-ad {
    width: 160px;
}

.side-ad .vertical {
    padding: 20px 10px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.side-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Top and bottom banners */
.top-ad, .bottom-ad {
    margin-bottom: 20px;
}

.top-ad .ad-container, .bottom-ad .ad-container {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

/* Mid-page banner */
.mid-ad {
    margin: 30px 0;
}

.mid-ad .horizontal {
    padding: 20px;
}

/* Input section */
.input-section {
    margin-bottom: 25px;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.counter {
    text-align: right;
    margin-top: 5px;
    color: #718096;
    font-size: 14px;
}

/* Controls */
.controls {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.voice-settings {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.voice-settings select, .voice-settings input {
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
}

.voice-settings select {
    grid-column: span 2;
}

.buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn i {
    font-size: 18px;
}

.btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn.secondary {
    background: #cbd5e0;
    color: #4a5568;
}

.btn.success {
    background: #48bb78;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* History */
.history-section {
    margin-top: 30px;
}

.history-section h3 {
    margin-bottom: 15px;
    color: #4a5568;
}

#historyList {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

#historyList li {
    padding: 10px;
    background: #f7fafc;
    margin-bottom: 5px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.history-text {
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-date {
    color: #718096;
    font-size: 12px;
}

/* Popup advertisement */
.popup-ad {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.popup-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 300px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    position: relative;
    border: 3px solid #fbbf24;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #f56565;
}

.popup-icon {
    font-size: 48px;
    color: #fbbf24;
    display: block;
    text-align: center;
    margin-bottom: 15px;
}

.popup-content h3 {
    text-align: center;
    margin-bottom: 10px;
    color: #2d3748;
}

.popup-content p {
    text-align: center;
    margin-bottom: 20px;
    color: #718096;
}

.popup-button {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s;
}

.popup-button:hover {
    transform: scale(1.05);
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    padding: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    main {
        flex-direction: column;
    }
    
    .side-ad {
        width: 100%;
        display: flex;
        gap: 20px;
    }
    
    .side-ad .vertical {
        min-height: auto;
        width: 100%;
    }
    
    .voice-settings {
        grid-template-columns: 1fr;
    }
    
    .voice-settings select {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .ad-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Language selector specific styles */
.voice-settings select#languageSelect {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.voice-settings select#languageSelect option {
    background: white;
    color: #333;
}

.history-lang {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    margin-right: 8px;
}

.empty-history {
    text-align: center;
    color: #718096;
    padding: 20px;
}
/* ============================================
   THUTHE BRANDING
   ============================================ */

header h1 {
    font-size: 3em;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.2);
}

header .tagline {
    font-size: 1.1em;
    opacity: 0.9;
    margin-bottom: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 300;
}

.footer-brand {
    font-size: 1.1em;
    margin-bottom: 10px;
    opacity: 0.95;
}

.footer-ai {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 10px;
    font-style: italic;
}

.footer-links {
    margin-top: 10px;
    font-size: 13px;
}

.footer-links a {
    color: white;
    text-decoration: underline;
    opacity: 0.85;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

/* ============================================
   COOKIE BANNER
   ============================================ */

.cookie-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 30, 40, 0.98);
    color: white;
    padding: 20px;
    z-index: 9999;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-banner.show {
    display: block;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-content p {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.cookie-content a {
    color: #fbbf24;
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.cookie-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.cookie-btn.accept {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.cookie-btn.reject {
    background: transparent;
    color: white;
    border: 2px solid #cbd5e0;
}

.cookie-btn:hover {
    transform: scale(1.05);
}

@media (max-width: 640px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }
    
    header h1 {
        font-size: 2.2em;
    }
}