:root {
    --bg-base: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #8b5cf6;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding: 2rem;
}

/* Ambient Background Orbs */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: float 20s infinite alternate ease-in-out;
}
.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.15);
    top: -100px;
    left: -100px;
}
.orb-2 {
    width: 500px;
    height: 500px;
    background: rgba(139, 92, 246, 0.15);
    bottom: -150px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

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

.glass-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.glass-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

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

.header-content h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

.header-content p {
    font-size: 0.875rem;
    color: var(--text-muted);
}
.header-content p span {
    color: #e2e8f0;
    font-weight: 600;
}

.api-key-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}
.api-key-section input[type="password"] {
    width: 250px;
}
.remember-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Config Section */
.config-section {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.input-group label, .section-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
}

.textarea-main {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.content-types {
    margin-bottom: 2rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 2rem;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
    color: var(--text-muted);
    transition: color 0.3s;
}
.custom-checkbox:hover {
    color: var(--text-main);
}
.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    transition: all 0.3s;
}
.custom-checkbox:hover input ~ .checkmark {
    border-color: var(--accent);
}
.custom-checkbox input:checked ~ .checkmark {
    background: var(--primary-gradient);
    border: none;
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}
.custom-checkbox input:checked ~ span {
    color: var(--text-main);
    font-weight: 600;
}

/* Buttons */
.glass-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 1rem;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.primary-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(59, 130, 246, 0.5);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}
.secondary-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Status & Loader */
.status-container {
    margin-top: 1.5rem;
    text-align: center;
}
#statusMessage {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.progress-bar {
    height: 6px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.loader {
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    position: absolute;
    right: 20px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.hidden { display: none !important; }

/* Output Grid */
.output-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.content-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    animation: slideUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-body {
    white-space: pre-wrap;
    line-height: 1.6;
    color: #e2e8f0;
    font-size: 0.95rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 1rem;
}

/* Custom Scrollbar for Card Body */
.card-body::-webkit-scrollbar {
    width: 6px;
}
.card-body::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}
.card-body::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}
