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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.navbar {
	width: 100%;
	max-width: 960px;
	margin: 0 auto 14px auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 4px;
}
.nav-left { display:flex; align-items:center; gap:10px; }
.nav-title { font-weight: 800; font-size: 1.1rem; color: #00ff88; }
.nav-links { display:flex; gap: 12px; }
.nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; font-weight: 600; }
.nav-links a:hover { color: #00ff88; }

.container {
    max-width: 600px;
    width: 100%;
    
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.logo-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 999px;
	background: linear-gradient(45deg, #00ff88, #00cc6a);
	box-shadow: 0 10px 25px rgba(0, 255, 136, 0.25);
	vertical-align: -12px;
	margin-right: 10px;
}

.logo-btn-icon {
	width: 62px;
	height: 62px;
}

.fart-counter {
	text-align: center;
	margin-top: -20px;
	margin-bottom: 30px;
	color: rgba(255, 255, 255, 0.9);
	font-weight: 600;
}

/* Tabs */
.tabs { 
	display: flex; 
	gap: 8px; 
	margin: 10px 0 20px 0; 
	justify-content: center;
}
.tab { 
	background: transparent; 
	border: 1px solid rgba(0, 255, 136, 0.35); 
	color: #00ff88; 
	padding: 8px 14px; 
	border-radius: 999px; 
	cursor: pointer; 
	font-weight: 600; 
	transition: all 0.2s ease; 
}
.tab:hover { 
	background: rgba(0, 255, 136, 0.1); 
	transform: translateY(-1px); 
	box-shadow: 0 6px 16px rgba(0, 255, 136, 0.22); 
}
.tab.active { 
	background: linear-gradient(45deg, #00ff88, #00cc6a); 
	color: #000; 
	border-color: transparent; 
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* removed inline API key inputs in favor of backend */

.input-section {
    margin-bottom: 30px;
}

.prompt-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.clear-btn {
	background: transparent;
	border: 1px solid rgba(0, 255, 136, 0.35);
	color: #00ff88;
	padding: 6px 12px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	transition: all 0.2s ease;
}

.clear-btn:hover {
	background: rgba(0, 255, 136, 0.1);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 255, 136, 0.22);
}

.label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 500;
    color: #00ff88;
}

.text-input {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.text-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.length-section {
    margin: 20px 0;
}

.length-label {
    display: block;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: #00ff88;
}

.length-slider {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.length-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.length-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.length-slider::-webkit-slider-track {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    border-radius: 4px;
    height: 8px;
}

.length-slider::-moz-range-track {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    border-radius: 4px;
    height: 8px;
    border: none;
}

.hints {
    margin: 20px 0;
}

.hint-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.hint-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hint-tag {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    color: #000;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.hint-tag:hover {
    transform: scale(1.05);
}

.generate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 255, 136, 0.3);
}

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

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-section {
    margin: 30px 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    border-radius: 4px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    color: #00ff88;
    font-size: 1rem;
    font-weight: 500;
}

.audio-section {
    margin: 30px 0;
    text-align: center;
}

.audio-title {
    color: #00ff88;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.thumbnail-container {
    margin-bottom: 20px;
    text-align: center;
}

.result-thumbnail {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(0, 255, 136, 0.3);
    background: linear-gradient(45deg, rgba(0, 255, 136, 0.1), rgba(0, 204, 106, 0.1));
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Dropzone */
.dropzone {
	border: 2px dashed rgba(0, 255, 136, 0.35);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.04);
	padding: 24px;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s ease;
}
.dropzone:hover { box-shadow: 0 10px 25px rgba(0, 255, 136, 0.2); transform: translateY(-1px); }
.dropzone.dragover { background: rgba(0, 255, 136, 0.08); border-color: #00ff88; }
.dropzone-inner { display:flex; flex-direction:column; gap:6px; align-items:center; }
.dropzone-title { color:#00ff88; font-weight:700; }
.dropzone-subtitle { color: rgba(255,255,255,0.8); font-size:0.9rem; }

.file-preview { display:flex; align-items:center; gap:8px; margin-top:10px; }
.file-preview .file-icon { font-size: 1.2rem; }

.result-thumbnail:hover {
    transform: scale(1.02);
    border-color: rgba(0, 255, 136, 0.6);
    box-shadow: 0 12px 35px rgba(0, 255, 136, 0.4);
}

.audio-player {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 10px;
}

.play-btn {
	background: linear-gradient(45deg, #00ff88, #00cc6a);
	border: none;
	border-radius: 999px;
	padding: 14px 18px;
	cursor: pointer;
	box-shadow: 0 10px 25px rgba(0, 255, 136, 0.25);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(0, 255, 136, 0.35);
}

.play-btn-icon {
	width: 28px;
	height: 28px;
}

.download-btn {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    border: none;
    border-radius: 8px;
    color: #000;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 255, 136, 0.3);
}

.gallery {
	margin-top: 20px;
}

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
	margin-top: 12px;
}

.gallery-item {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: relative;
	overflow: hidden;
}

.gallery-item-inner {
	position: relative;
}

.gallery-thumbnail-container {
	position: relative;
	margin-bottom: 8px;
}

.gallery-item-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	opacity: 0;
	transition: opacity 0.3s ease;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 8px;
}

.gallery-item:hover .gallery-item-overlay {
	opacity: 1;
}

.gallery-item:hover .gallery-item-overlay {
	opacity: 1;
}

.gallery-item-overlay .play-btn,
.gallery-item-overlay .link-btn {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: linear-gradient(45deg, #00ff88, #00cc6a);
	box-shadow: 0 8px 20px rgba(0, 255, 136, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	color: #000;
	text-decoration: none;
}

.gallery-item-overlay .play-btn:hover,
.gallery-item-overlay .link-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 25px rgba(0, 255, 136, 0.4);
}

.gallery-item-overlay .play-btn i,
.gallery-item-overlay .link-btn i {
	font-size: 18px;
}

.gallery-thumb-wrap { position: relative; }
.gallery-actions-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	opacity: 0;
	transition: opacity 0.2s ease;
	background: linear-gradient(0deg, rgba(0,0,0,0.35), rgba(0,0,0,0.0));
}
.gallery-item:hover .gallery-actions-overlay { opacity: 1; }
.circle-btn {
	width: 42px; height: 42px; border-radius: 999px; border: none; cursor: pointer;
	background: linear-gradient(45deg, #00ff88, #00cc6a);
	box-shadow: 0 10px 25px rgba(0, 255, 136, 0.25);
	display:flex; align-items:center; justify-content:center;
}
.circle-btn img { width: 20px; height: 20px; }

.gallery-item .gallery-thumbnail {
	aspect-ratio: 1;
	height: auto;
	width: 100%;
}

.gallery-thumbnail {
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 8px;
	background: linear-gradient(45deg, rgba(0, 255, 136, 0.1), rgba(0, 204, 106, 0.1));
	cursor: pointer;
	transition: all 0.3s ease;
	border: 2px solid transparent;
}

.gallery-thumbnail:hover {
	transform: scale(1.05);
	border-color: rgba(0, 255, 136, 0.5);
	box-shadow: 0 8px 25px rgba(0, 255, 136, 0.3);
}

.gallery-meta {
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.8);
}
.gallery-meta .prompt-collapsed { cursor: pointer; text-decoration: underline; }

/* Gallery play button removed - now using thumbnail as button */

.gallery-actions {
	margin-top: 16px;
	display: flex;
	justify-content: center;
}

.load-more-btn {
	background: transparent;
	border: 1px solid rgba(0, 255, 136, 0.35);
	color: #00ff88;
	padding: 10px 16px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	transition: all 0.2s ease;
}

.load-more-btn:hover {
	background: rgba(0, 255, 136, 0.1);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 255, 136, 0.22);
}

.error-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 8px;
    text-align: center;
}

.error-text {
    color: #ff6b6b;
    font-size: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .hint-tags {
        justify-content: center;
    }
}
