:root {
    --bg-color: #0f172a;
    --sidebar-bg: rgba(30, 41, 59, 0.7);
    --card-bg: rgba(30, 41, 59, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-1: #3b82f6;
    --accent-2: #8b5cf6;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 600;
}

.gradient-text {
    background: linear-gradient(to right, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

/* Layout */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.logo h2 {
    font-size: 1.8rem;
    margin-bottom: 3rem;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent-1);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: block;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-links a.active {
    border-left: 3px solid var(--accent-1);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
}

.content {
    flex: 1;
    margin-left: 260px;
    padding: 3rem;
    position: relative;
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Components */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80vh;
    text-align: center;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
textarea,
select.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all 0.3s ease;
}

select.form-control option,
select.form-control optgroup {
    background: var(--bg-color);
    color: var(--text-primary);
}

input:focus,
textarea:focus,
select.form-control:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

textarea {
    resize: vertical;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

/* Playground Specific */
.playground-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.file-upload-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

input[type="file"] {
    background: rgba(15, 23, 42, 0.6);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    width: 100%;
    color: var(--text-secondary);
    cursor: pointer;
}

.image-preview {
    margin-top: 1rem;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.response-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.markdown-body {
    flex: 1;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 600px;
    line-height: 1.6;
}

.markdown-body p {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.markdown-body pre {
    background: #000;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-body code {
    font-family: monospace;
    color: #a5b4fc;
}

.placeholder-text {
    color: var(--text-secondary) !important;
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

/* Messages */
.message {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 6px;
    display: none;
}

.message.success {
    display: block;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.message.error {
    display: block;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Loader */
.btn-generate {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    -webkit-animation: spin 1s linear infinite;
    /* Safari */
    animation: spin 1s linear infinite;
}

.loader.hidden {
    display: none;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* History List */
.history-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.history-prompt {
    margin-bottom: 1rem;
    font-size: 11px;
    min-width: 400px;
    text-wrap: wrap;
}

.history-image img {
    max-width: 200px;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.history-response {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 900px) {
    .playground-container {
        grid-template-columns: 1fr;
    }
}