:root {
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --card-bg: rgba(255, 255, 255, 0.6);
    --glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --accent-color: #4f46e5;
    /* Indigo 600 */
    --accent-hover: #4338ca;
    --accent-light: #e0e7ff;
    --radius: 16px;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Background Animated Orbs */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: #a5b4fc;
    top: -100px;
    left: -100px;
    animation: float 10s infinite ease-in-out;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: #fbcfe8;
    bottom: -50px;
    right: -50px;
    animation: float 12s infinite ease-in-out reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, 40px);
    }

    100% {
        transform: translate(0, 0);
    }
}

* {
    box-sizing: border-box;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    backdrop-filter: blur(5px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-color);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--accent-color);
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    text-align: left;
    transition: all 0.2s;
    font-family: var(--font-heading);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--accent-light);
    color: var(--accent-color);
    font-weight: 600;
}

.sidebar-footer {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: center;
    opacity: 0.7;
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
}

.top-bar {
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* background: rgba(255, 255, 255, 0.3); */
    position: sticky;
    top: 0;
    z-index: 10;
}

#page-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: #111827;
}

/* Buttons */
.btn-primary {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f9fafb;
    color: var(--accent-color);
    border-color: var(--accent-light);
}

/* Tabs */
.tab-content {
    display: none;
    padding: 20px 40px 40px;
}

.tab-content.active {
    display: block;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glass Cards */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    height: calc(100vh - 140px);
}

.card {
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
}

.glass {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

.input-panel h2,
.output-panel h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.row {
    display: flex;
    gap: 20px;
}

.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #374151;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.8);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: white;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Output Area */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#output-text,
#webapp-output-text {
    flex: 1;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #1f2937;
    background: #ffffff;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    white-space: pre-wrap;
    overflow-y: auto;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #10b981;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s;
    z-index: 100;
}

.toast.hidden {
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        overflow: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-between;
        padding: 16px;
    }

    .nav-menu {
        flex-direction: row;
        flex: 0;
    }

    .nav-item span {
        display: none;
    }

    .content-area {
        overflow: visible;
    }
}