/* Reset and Variables */
:root {
    --bg-dark: #07090e;
    --card-bg: rgba(15, 20, 30, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    
    /* Vibrant accent colors */
    --accent-grok: #1da1f2; /* Grok/X neon blue */
    --accent-glow: rgba(29, 161, 242, 0.15);
    --accent-magenta: #e0245e;
    --accent-green: #00ba7c;
    --accent-yellow: #ffd400;

    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 2rem 1rem;
}

/* Background Ambient Glows */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(29, 161, 242, 0.12) 0%, rgba(224, 36, 94, 0.05) 50%, transparent 100%);
    top: -10%;
    left: -10%;
    z-index: 0;
    pointer-events: none;
    filter: blur(80px);
    animation: pulseGlow 15s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(10%, 10%); }
}

.container {
    width: 100%;
    max-width: 1000px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Navigation Top Bar */
.top-nav {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding: 0.5rem 0;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 3.5rem;
    width: 100%;
    align-items: start;
}

/* Left Sidebar styling */
.sidebar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    padding-top: 1.5rem;
}

.sidebar-footer {
    margin-top: 4rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    opacity: 0.55;
    line-height: 1.5;
}

.sidebar-ad-slot {
    width: 100%;
    margin-top: 1.5rem;
    min-height: 250px;
    border-radius: 12px;
    overflow: hidden;
}

.badge {
    background: rgba(29, 161, 242, 0.1);
    color: var(--accent-grok);
    border: 1px solid rgba(29, 161, 242, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.title {
    font-size: 2.75rem;
    font-weight: 850;
    background: linear-gradient(135deg, #ffffff 30%, var(--accent-grok) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Main Card Glassmorphism */
.main-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

.main-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

/* Input Fields */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

textarea {
    width: 100%;
    height: 80px;
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: var(--transition-smooth);
}

textarea:focus {
    border-color: var(--accent-grok);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Button & Loading Styles */
.glow-button {
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.glow-button:hover {
    background: var(--accent-grok);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(29, 161, 242, 0.4);
    transform: translateY(-2px);
}

.glow-button:active {
    transform: translateY(0);
}

.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Output Console Styling */
.output-section {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: #090b10;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background-color: var(--accent-magenta); }
.dot.yellow { background-color: var(--accent-yellow); }
.dot.green { background-color: var(--accent-green); }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.terminal-body {
    padding: 1.5rem;
    max-height: 350px;
    overflow-y: auto;
}

.roast-text {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.roast-text.error-text {
    color: var(--accent-magenta);
    font-family: var(--font-mono);
}

/* Cursor blinking animation */
.roast-text::after {
    content: '▋';
    color: var(--accent-grok);
    animation: blink 1s step-start infinite;
}

.roast-text.finished::after {
    display: none;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Share button */
.actions-row {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.share-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.x-icon {
    width: 14px;
    height: 14px;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .sidebar {
        align-items: center;
        text-align: center;
        padding-top: 0.5rem;
    }
    .sidebar-footer {
        display: none;
    }
    .title {
        font-size: 2.2rem;
    }
    .main-card {
        padding: 1.5rem;
    }
}

/* Header Adjustments */
.header-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    margin-top: 0.5rem;
}

.settings-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.settings-trigger svg {
    width: 20px;
    height: 20px;
    transition: transform 0.6s ease;
}

.settings-trigger:hover {
    color: var(--accent-grok);
    background: rgba(29, 161, 242, 0.1);
    border-color: rgba(29, 161, 242, 0.3);
    box-shadow: 0 0 15px var(--accent-glow);
}

.settings-trigger:hover svg {
    transform: rotate(45deg);
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 9, 14, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: #0f141e;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 440px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 75vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.modal-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

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

.modal-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-input {
    width: 100%;
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.modal-input:focus {
    border-color: var(--accent-grok);
    box-shadow: 0 0 10px var(--accent-glow);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.save-button {
    background: var(--accent-grok);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.save-button:hover {
    background: #1994e0;
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-1px);
}

/* Header Actions & OAuth Layouts */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.login-trigger {
    background: var(--accent-grok);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 0 10px rgba(29, 161, 242, 0.2);
}

.login-trigger:hover {
    background: #1994e0;
    box-shadow: 0 0 15px rgba(29, 161, 242, 0.4);
    transform: translateY(-1px);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 186, 124, 0.08);
    border: 1px solid rgba(0, 186, 124, 0.15);
    padding: 0.45rem 1rem;
    border-radius: 9999px;
}

.user-status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulseDot 2s infinite alternate ease-in-out;
}

@keyframes pulseDot {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

.user-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logout-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition-smooth);
}

.logout-link:hover {
    color: var(--accent-magenta);
    text-decoration: underline;
}

/* OAuth Loading Screen */
.oauth-loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1.5rem;
    text-align: center;
}

.oauth-loading-screen p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Modal Divider & Form Extras */
.modal-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.5rem 0;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.input-with-button .modal-input {
    flex: 1;
}

.save-button.small-btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    flex-shrink: 0;
    white-space: nowrap;
}



/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 20, 30, 0.95);
    border: 1px solid var(--accent-grok);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(29, 161, 242, 0.25);
    pointer-events: none;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Tabbed Modal Navigation */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

.modal-tab-btn {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-tab-btn:hover {
    color: var(--text-primary);
}

.modal-tab-btn.active {
    color: var(--accent-grok);
    border-bottom-color: var(--accent-grok);
}

.tab-content.hidden {
    display: none !important;
}

/* Usage Statistics Layout */
.usage-stats-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.usage-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.stats-card {
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stats-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-grok);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.35rem;
    margin-bottom: 0.25rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-label {
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.stat-row.highlight {
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    font-weight: 700;
}

.stat-row.highlight .stat-label {
    color: var(--text-primary);
}

.stat-row.highlight .stat-value {
    color: var(--accent-yellow);
    font-size: 0.9rem;
}

.stat-row.highlight.green .stat-value {
    color: var(--accent-green);
}

.stats-footer {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.save-button.reset-btn {
    background: transparent;
    border: 1px solid rgba(224, 36, 94, 0.3);
    color: var(--accent-magenta);
}

.save-button.reset-btn:hover {
    background: rgba(224, 36, 94, 0.1);
    border-color: var(--accent-magenta);
    box-shadow: 0 0 10px rgba(224, 36, 94, 0.15);
    transform: translateY(-1px);
}

select.modal-input option {
    background: #0f141e;
    color: var(--text-primary);
}

/* AdSense Ad Slot */
.adsense-slot {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    min-height: 50px;
}

.adsense-slot ins {
    border-radius: 12px;
}



