/* ==========================================================================
   FREE TOOLS - PROFESSIONAL TEXT & PRODUCTIVITY SUITE
   ========================================================================== */

:root {
    /* Color Palette - Dark Theme Default */
    --bg-base: #0c0f17;
    --bg-surface: #141923;
    --bg-surface-elevated: #1a2232;
    --bg-surface-hover: #222b3e;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-prominent: rgba(255, 255, 255, 0.16);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --brand-primary: #3b82f6;
    --brand-primary-hover: #2563eb;
    --brand-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    
    --accent-blue: #38bdf8;
    --accent-purple: #a855f7;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-teal: #14b8a6;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-surface-hover: #e2e8f0;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-prominent: rgba(0, 0, 0, 0.16);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* Base Reset & Core Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.app-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--brand-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

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

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #60a5fa 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-text h1 {
    background: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--brand-primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
    background: var(--bg-surface-elevated);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
}

.status-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ==========================================================================
   Quick Stats Grid
   ========================================================================== */
.quick-stats-section {
    padding: 1.25rem 0 0.5rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-prominent);
    box-shadow: var(--shadow-md);
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-wrapper.blue { background: rgba(56, 189, 248, 0.12); color: var(--accent-blue); }
.stat-icon-wrapper.purple { background: rgba(168, 85, 247, 0.12); color: var(--accent-purple); }
.stat-icon-wrapper.green { background: rgba(16, 185, 129, 0.12); color: var(--accent-green); }
.stat-icon-wrapper.amber { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); }
.stat-icon-wrapper.teal { background: rgba(20, 184, 166, 0.12); color: var(--accent-teal); }

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Main Workspace Layout
   ========================================================================== */
.app-workspace {
    flex: 1;
    padding: 1rem 0 2.5rem 0;
}

.main-layout {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 1.5rem;
}

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* ==========================================================================
   Editor Column
   ========================================================================== */
.editor-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.editor-card {
    display: flex;
    flex-direction: column;
    height: 600px;
    border: 1px solid var(--border-subtle);
}

.editor-toolbar {
    background-color: var(--bg-surface-elevated);
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tool-divider {
    width: 1px;
    height: 20px;
    background-color: var(--border-subtle);
    margin: 0 0.25rem;
}

.tool-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tool-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-prominent);
}

.textarea-container {
    flex: 1;
    position: relative;
    display: flex;
}

#textInput {
    width: 100%;
    height: 100%;
    padding: 1.25rem;
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1.05rem;
    line-height: 1.7;
    resize: none;
    outline: none;
    transition: var(--transition);
}

#textInput::placeholder {
    color: var(--text-muted);
}

.editor-footer {
    padding: 0.6rem 1.25rem;
    background-color: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.typing-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent-green);
    font-weight: 500;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-green);
}

.shortcut-tip {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Goal Tracker Card */
.goal-card {
    padding: 1.25rem;
}

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

.goal-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand-primary);
}

.goal-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.goal-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.goal-progress-bar {
    width: 100%;
    height: 10px;
    background-color: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.6rem;
    border: 1px solid var(--border-subtle);
}

.goal-progress-fill {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.goal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.typing-speed {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-blue);
}

/* ==========================================================================
   Sidebar Column & Tabs
   ========================================================================== */
.sidebar-column {
    display: flex;
    flex-direction: column;
}

.sidebar-tabs {
    display: flex;
    background-color: var(--bg-surface-elevated);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid var(--border-subtle);
    gap: 0.25rem;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.tab-btn.active {
    background-color: var(--bg-surface);
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

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

/* ==========================================================================
   Tab 1: Time Management Suite
   ========================================================================== */
.timer-card {
    padding: 1.5rem;
    text-align: center;
}

.card-title-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.badge-pill {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    margin-bottom: 0.4rem;
}

.card-title-group h4 {
    font-size: 1.15rem;
    font-weight: 700;
}

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

.timer-mode-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.timer-mode-btn {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.timer-mode-btn:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.timer-mode-btn.active {
    background: var(--brand-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.timer-display-wrapper {
    display: flex;
    justify-content: center;
    margin: 1.25rem 0;
}

.timer-circle-svg {
    position: relative;
    width: 220px;
    height: 220px;
}

.circular-chart {
    display: block;
    max-width: 100%;
    max-height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: var(--bg-surface-elevated);
    stroke-width: 5;
}

.circle-progress {
    fill: none;
    stroke: var(--brand-primary);
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease;
}

.timer-time-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#timerDisplay {
    font-size: 2.8rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.timer-state-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent-green);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.productivity-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.p-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.p-val {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.p-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Tab 2: Deep Analytics & Readability
   ========================================================================== */
.analytics-card {
    padding: 1.5rem;
}

.readability-badge-box {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
}

.readability-score {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--accent-green);
    line-height: 1;
}

.readability-meta {
    display: flex;
    flex-direction: column;
}

.readability-level {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.readability-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-box {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 0.85rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
}

.m-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.m-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.keywords-section h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.keywords-table-container {
    max-height: 230px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.keywords-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
    text-align: left;
}

.keywords-table th {
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    padding: 0.6rem 0.85rem;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.keywords-table td {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.keywords-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Tab 3: AI ChatBot Hub
   ========================================================================== */
.chatbot-card {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chatbot-header {
    padding: 0.85rem 1.25rem;
    background-color: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.ai-header-info {
    flex: 1;
}

.ai-header-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}

.ai-online-status {
    font-size: 0.75rem;
    color: var(--accent-green);
}

.chat-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-bubble {
    display: flex;
    max-width: 88%;
    animation: fadeIn 0.2s ease;
}

.user-bubble {
    align-self: flex-end;
}

.user-bubble .bubble-content {
    background: var(--brand-gradient);
    color: #ffffff;
    border-radius: 14px 14px 2px 14px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

.bot-bubble {
    align-self: flex-start;
}

.bot-bubble .bubble-content {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 14px 14px 14px 2px;
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
}

.bubble-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.bubble-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-blue);
    cursor: pointer;
    transition: var(--transition);
}

.bubble-btn:hover {
    background: rgba(59, 130, 246, 0.3);
}

.quick-chips-wrapper {
    padding: 0.5rem 0.85rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    white-space: nowrap;
}

.quick-chips-wrapper::-webkit-scrollbar {
    height: 4px;
}

.quick-chips-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
}

.chip-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.chip-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-prominent);
}

.chat-input-row {
    padding: 0.75rem 1rem;
    background-color: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 0.5rem;
}

#chatInput {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
}

#chatInput:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ==========================================================================
   Buttons & Dropdowns
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-main);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.7rem 1.4rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--brand-gradient);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-prominent);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    background: var(--accent-rose);
    color: #ffffff;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-ghost:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

.input-sm {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    color: var(--text-primary);
    width: 75px;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
}

/* Dropdown Menu */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-prominent);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 170px;
    display: none;
    flex-direction: column;
    z-index: 100;
    padding: 0.4rem;
}

.dropdown-menu.show {
    display: flex;
    animation: fadeIn 0.15s ease;
}

.dropdown-item {
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--brand-primary);
    color: #ffffff;
}

/* ==========================================================================
   Floating Chat Trigger
   ========================================================================== */
.floating-chat-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 90;
    transition: var(--transition);
}

.floating-chat-trigger:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.chat-badge-dot {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent-green);
    border: 2px solid var(--bg-surface);
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 999;
    pointer-events: none;
}

.toast {
    background-color: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-prominent);
    border-radius: var(--radius-full);
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.25s ease 2.75s forwards;
    pointer-events: auto;
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.5); }
.toast.toast-info { border-color: rgba(59, 130, 246, 0.5); }
.toast.toast-danger { border-color: rgba(244, 63, 94, 0.5); }

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

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 1.25rem 0;
    font-size: 0.825rem;
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.privacy-lock {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent-green);
    font-weight: 500;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .editor-card {
        height: 500px;
    }

    .chatbot-card {
        height: 520px;
    }
}

@media (max-width: 640px) {
    .header-container {
        padding: 0.75rem 1rem;
    }

    .header-status {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .transforms-group {
        display: none;
    }

    .editor-card {
        height: 420px;
    }

    .timer-mode-buttons {
        grid-template-columns: 1fr 1fr;
    }
}
