/* Global Reset & Base Variables */
:root {
    --bg-primary: #080a0f;
    --bg-secondary: #0f131a;
    --panel-bg: rgba(16, 22, 32, 0.7);
    --panel-border: rgba(255, 255, 255, 0.05);
    
    --accent-color: #10b981; /* Emerald/Cyan-green */
    --accent-glow: rgba(16, 185, 129, 0.15);
    --accent-hover: #059669;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #030712;
    
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* Background Gradients & Glows */
.decor-glow-1 {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

.decor-glow-2 {
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* App Container Layout */
.app-container {
    width: 100%;
    max-width: 1280px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 100vh;
}

/* Header Styles */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

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

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 12px var(--accent-glow);
    object-fit: cover;
}

.brand-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--text-main), #a7f3d0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text .tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Wallet Connection Badge */
.wallet-section {
    display: flex;
    align-items: center;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--text-inverse);
    border: none;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

#wallet-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.indicator.green {
    background-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
}

.balance-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
    padding: 0.1rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Workspace Main Grid */
.app-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    flex-grow: 1;
}

@media (max-width: 900px) {
    .app-main {
        grid-template-columns: 1fr;
    }
}

/* Panel Cards */
.panel-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.panel-header {
    margin-bottom: 2rem;
}

.panel-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.price-notice {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.price-notice strong {
    color: var(--accent-color);
}

.eyebrow {
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 0.5rem;
}

.offer-summary,
.safety-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 0.75rem;
}

.safety-note {
    border-left: 3px solid var(--accent-color);
    padding-left: 0.9rem;
}

.proof-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.proof-links a,
.empty-state a {
    text-decoration: none;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group.full-width {
        grid-column: span 1;
    }
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select, textarea {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 10px var(--accent-glow);
}

textarea {
    resize: vertical;
}

/* Buttons */
.btn-action {
    background: var(--accent-color);
    color: var(--text-inverse);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 6px 20px var(--accent-glow);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-action:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-action:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.full-width {
    width: 100%;
}

/* Results Viewer Panel */
.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1rem;
    flex-grow: 1;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.4;
}

.empty-state h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    font-size: 1.3rem;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 320px;
}

/* Document Viewer & Tabs */
.results-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.results-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
}

.title-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--panel-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.tab-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.tabs-nav {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
}

.tab-btn {
    background: none;
    border: none;
    border-right: 1px solid var(--panel-border);
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--accent-color);
    background: rgba(16, 185, 129, 0.04);
    font-weight: 600;
}

.tab-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem;
    overflow: hidden;
}

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

.doc-header h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    font-size: 1.1rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.btn-text:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.doc-markdown {
    flex-grow: 1;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #e5e7eb;
    white-space: pre-wrap;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
}

/* Processing Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 10, 15, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    max-width: 320px;
    padding: 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(16, 185, 129, 0.1);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px var(--accent-glow);
}

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

.loader-box h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
}

.loader-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Process Step Lists */
.process-steps {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
    margin-top: 1rem;
}

.step {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: var(--transition-fast);
}

.step.pending {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    border-color: var(--panel-border);
}

.step.active {
    background: rgba(16, 185, 129, 0.05);
    color: var(--accent-color);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.08);
}

.step.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
    text-decoration: line-through;
    opacity: 0.6;
}

/* Utility Hidden */
.hidden {
    display: none !important;
}

/* Footer */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--panel-border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-color);
}

@media (max-width: 600px) {
    .app-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
