/* Modern Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Color Palette - Green & White Premium */
    --primary: #10B981;
    /* Emerald 500 */
    --primary-hover: #059669;
    /* Emerald 600 */
    --primary-light: #D1FAE5;
    /* Emerald 100 */
    --primary-subtle: #ECFDF5;
    /* Emerald 50 */

    --surface-white: #FFFFFF;
    --surface-off: #F9FAFB;

    --text-primary: #111827;
    /* Gray 900 */
    --text-secondary: #4B5563;
    /* Gray 600 */
    --text-tertiary: #9CA3AF;
    /* Gray 400 */

    --border: #E5E7EB;
    --border-hover: #D1D5DB;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-color: rgba(16, 185, 129, 0.25);

    --radius-md: 12px;
    --radius-lg: 20px;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #F3F4F6;
    background-image:
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Layout */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    gap: 0.5rem;
}

.logo-icon {
    color: var(--primary);
    display: flex;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.profile-link {
    font-weight: 600 !important;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.header-section {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.header-section h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.text-gradient {
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Grid Layout */
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
}

@media (min-width: 960px) {
    .workspace-grid {
        grid-template-columns: 400px 1fr;
        align-items: start;
    }
}

/* Panels */
.input-panel,
.results-panel {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--surface-white);
    /* subtle border */
}

.glass-panel {
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.input-panel {
    padding: 2rem;
    position: sticky;
    top: 0;
}

.results-panel {
    min-height: 500px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    background: var(--surface-off);
    color: var(--text-secondary);
    font-weight: 600;
}

.badge.success {
    background: var(--primary-light);
    color: var(--primary-hover);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.half {
    flex: 1;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.helper-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    margin-top: -0.25rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--surface-off);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--surface-white);
}

/* Button */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.23);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary {
    display: block;
    margin: 2rem auto 0;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-tertiary);
    min-height: 400px;
}

.illustration {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
}

.circle {
    position: absolute;
    border-radius: 50%;
}

.c1 {
    width: 100px;
    height: 100px;
    background: var(--primary-light);
    top: 10px;
    left: 10px;
    opacity: 0.5;
}

.c2 {
    width: 60px;
    height: 60px;
    background: var(--primary);
    top: 30px;
    left: 30px;
    opacity: 0.2;
}

.icon-float {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: 0.2s;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--primary-subtle);
}

.tab-btn.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
}

/* Result Cards */
.result-card {
    display: none;
    background: var(--surface-off);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.result-card.active-card {
    display: block;
}

.card-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-hover);
}

.card-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.card-body {
    white-space: pre-wrap;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.7;
}

.card-footer {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.meta-tag {
    font-size: 0.75rem;
    background: #E5E7EB;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.action-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.action-icon:hover {
    color: var(--primary);
}

/* Utils */
.hidden {
    display: none !important;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    z-index: 200;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .navbar {
        padding: 1rem;
    }

    .nav-links {
        display: none;
    }
}