:root {
    --bg-color: #0a0e17;
    --panel-bg: rgba(16, 24, 40, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Elementor Colors */
    --accent-glow: #d53369;
    --accent-glow-2: #922253; 
    --btn-primary: linear-gradient(135deg, #d53369 0%, #922253 100%);
    --btn-hover: linear-gradient(135deg, #ff4d85 0%, #d53369 100%);
    
    --glass-blur: blur(16px);
    --success: #10b981;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Gradients */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 10s infinite ease-in-out alternate;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-glow-2) 0%, transparent 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

/* Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.logo i {
    color: #ff4d85;
    text-shadow: 0 0 20px rgba(213, 51, 105, 0.5);
}

header h1 {
    font-weight: 700;
}

header h1 span {
    font-weight: 300;
    color: var(--text-secondary);
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* API Key Section */
.api-key-wrapper {
    margin: 2rem auto 0;
    display: flex;
    flex-wrap: wrap; /* Prevents overflow */
    justify-content: center;
    align-items: center;
    max-width: 850px; /* Increased from 650px to hold the new fields */
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.8rem 1.2rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    gap: 1rem;
}

.api-key-wrapper:focus-within {
    border-color: rgba(213, 51, 105, 0.5);
    box-shadow: 0 10px 30px -10px rgba(213, 51, 105, 0.3);
}

.api-key-wrapper i.fa-key {
    color: #ff4d85;
    font-size: 1.1rem;
    background: rgba(213, 51, 105, 0.1);
    padding: 0.6rem;
    border-radius: 10px;
}

.api-key-wrapper input {
    flex: 1;
    min-width: 180px; /* Maintains a good typing width */
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

.api-key-wrapper input::placeholder {
    color: #475569;
}

.api-divider {
    width: 2px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 0.5rem;
    border-radius: 2px;
}

.model-select, .provider-select {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    outline: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2rem;
    max-width: 160px; /* Prevents overflow horizontally */
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.3s ease;
}

.model-select:hover, .provider-select:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(213, 51, 105, 0.4);
}

.model-select:focus, .provider-select:focus {
    border-color: #ff4d85;
    box-shadow: 0 0 0 2px rgba(213, 51, 105, 0.2);
}

/* Enhances the option dropdown natively */
.model-select option, .provider-select option {
    background-color: #1e1e28;
    color: #e2e8f0;
}

.btn-small {
    background: rgba(213, 51, 105, 0.15);
    color: #ff4d85;
    border: 1px solid rgba(213, 51, 105, 0.3);
    padding: 0.55rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-small:hover {
    background: rgba(213, 51, 105, 0.3);
    color: #fff;
}

.btn-small.saved {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

/* Input Section */
.input-section {
    text-align: left;
    margin-bottom: 3rem;
}

.input-section h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.input-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.textarea-wrapper {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.textarea-wrapper:focus-within {
    border-color: rgba(213, 51, 105, 0.5);
    box-shadow: 0 0 0 3px rgba(213, 51, 105, 0.15);
}

textarea {
    width: 100%;
    height: 300px;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    outline: none;
    resize: vertical;
}

textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.action-bar {
    display: flex;
    justify-content: flex-end;
}

.btn-glow {
    background: var(--btn-primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
}

.btn-glow:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(213, 51, 105, 0.6);
}

/* Loading State */
#loadingSection {
    text-align: center;
    padding: 4rem 0;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ff4d85;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    color: #ff4d85;
    font-weight: 500;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Results Section */
.hidden {
    display: none !important;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
}

.report-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--panel-border);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Visual Builder Container */
/* Code Container Styles */
.code-container {
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: as;
    background: #0d1117; 
    border-radius: 12px;
}

.code-container pre {
    margin: 0;
}

/* Enhancing Prism Theme inside app */
code[class*="language-"], pre[class*="language-"] {
    text-shadow: none !important;
}

/* Responsive Design (Mobile & Tablet) */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .logo {
        font-size: 1.8rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 0.95rem;
    }

    .glass-panel {
        padding: 1.2rem;
    }

    .api-key-wrapper {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .api-key-wrapper input {
        width: 100%;
    }

    .model-select, .provider-select {
        max-width: 100%;
        width: 100%;
    }

    .api-divider {
        display: none;
    }

    .report-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        padding: 1.2rem;
    }

    .report-meta {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .badge {
        justify-content: center;
    }

    .btn-secondary {
        justify-content: center;
        width: 100%;
    }

    .btn-glow {
        width: 100%;
        justify-content: center;
    }
}
