/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: #000;
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Grid Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    padding: 30px 0;
    border-bottom: 1px solid #333;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.header-text {
    flex: 1;
}

.logo {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.logo span {
    color: #00d9ff;
}

.tagline {
    color: #999;
    font-size: 14px;
}

/* Main */
main {
    padding: 40px 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover:not(.disabled) {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #00d9ff, #00a8cc);
    border-color: #00d9ff;
}

.tab-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.badge {
    display: inline-block;
    font-size: 10px;
    background: #ff9800;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
}

/* Tool Interface */
.tool-interface {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 30px;
}

.tool-panel {
    display: none;
}

.tool-panel.active {
    display: grid;
    grid-template-columns: minmax(400px, 1fr) minmax(400px, 1fr);
    gap: 30px;
    align-items: start;
}

.input-section {
    position: sticky;
    top: 20px;
}

.result-section {
    min-height: 400px;
}

.input-section h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.description {
    color: #999;
    font-size: 13px;
    margin-bottom: 20px;
    font-style: italic;
}

/* Forms */
textarea, input, select {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 15px;
    transition: all 0.3s;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

textarea:focus, input:focus, select:focus {
    outline: none;
    border-color: #00d9ff;
    box-shadow: 0 0 0 3px rgba(0,217,255,0.1);
}

/* Select dropdown styling */
select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300d9ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

select option {
    background: #1a1a1a;
    color: #fff;
    padding: 10px;
}

/* Number input - hide default arrows */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
    color: #ccc;
}

.seed-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.seed-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: rotate(20deg) scale(1.1);
}

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: #00d9ff;
    background: rgba(0,217,255,0.05);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-area p {
    color: #999;
    font-size: 14px;
}

.upload-area.has-image {
    padding: 0;
    border-style: solid;
    position: relative;
    overflow: hidden;
    min-height: auto;
    max-height: 400px;
}

.upload-area.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

/* Generate Button */
.btn-generate {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #00d9ff, #00a8cc);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,217,255,0.3);
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Result Area */
.result-section {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: sticky;
    top: 20px;
}

.result-area {
    width: 100%;
    min-height: 500px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.placeholder {
    color: #666;
    font-size: 16px;
    text-align: center;
    padding: 20px;
}

.result-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.result-area img {
    width: 100%;
    height: auto;
    display: block;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(0,217,255,0.3);
    border-radius: 8px;
    color: #00d9ff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.action-btn:hover {
    background: rgba(0,217,255,0.1);
    border-color: #00d9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,217,255,0.2);
}

.action-btn:active {
    transform: translateY(0);
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0,217,255,0.2);
    border-top-color: #00d9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-message {
    margin-top: 20px;
    font-size: 18px;
}

#loading-details {
    font-size: 14px;
    color: #999;
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .logo-img {
        width: 50px;
        height: 50px;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .tool-panel.active {
        grid-template-columns: 1fr;
    }
    
    .input-section, .result-section {
        position: static;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

