/* ==========================================
   PRO DEVELOPER TOOLS - MODERN MINIMAL UI
   ========================================== */

:root {
    --bg-start: #0f1117; --bg-end: #0f1117;
    --surface-dark: #161b22; --surface-light: #21262d; --border-color: #30363d;
    --text-primary: #e6edf3; --text-secondary: #8b949e;
    --accent-primary: #2f81f7; --color-success: #238636; --color-warning: #d29922;
    --color-danger: #f85149; --color-teal: #3fb950; --color-custom: #a371f7;
    --radius-md: 6px; --radius-lg: 12px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="light"] {
    --bg-start: #f6f8fa; --bg-end: #f6f8fa;
    --surface-dark: #ffffff; --surface-light: #f3f4f6; --border-color: #d0d7de;
    --text-primary: #24292f; --text-secondary: #57606a;
}

* { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: var(--font-main); background: var(--bg-start); color: var(--text-primary); line-height: 1.5; -webkit-font-smoothing: antialiased; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

h1, h2, h3 { margin-top: 0; font-weight: 600; }
.text-accent { color: var(--accent-primary); } .text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); } .text-danger { color: var(--color-danger); }
.text-teal { color: var(--color-teal); } .text-custom { color: var(--color-custom); }
.fw-bold { font-weight: 600; } .mb-15 { margin-bottom: 15px; }

/* Navigation & Header */
.header-btn { background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); padding: 6px 12px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.header-btn:hover { background: var(--surface-light); border-color: var(--text-secondary); }

.tab-nav { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.tab-btn { background: transparent; border: none; color: var(--text-secondary); padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: var(--radius-md); transition: 0.2s; }
.tab-btn:hover { color: var(--text-primary); background: var(--surface-dark); }
.tab-btn.active { background: var(--surface-light); color: var(--text-primary); border: 1px solid var(--border-color); }
.tab-pane { display: none; animation: fadeIn 0.3s ease; }
.tab-pane.active { display: block; }

/* Inputs */
.custom-input, select { width: 100%; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--surface-dark); color: var(--text-primary); font-family: var(--font-main); font-size: 14px; outline: none; transition: 0.2s; }
.custom-input:focus, select:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.2); }
.code-area { width: 100%; min-height: 350px; padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--surface-dark); color: var(--text-primary); font-family: var(--font-mono); font-size: 13px; resize: vertical; outline: none; transition: 0.2s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); }
.code-area:focus { border-color: var(--accent-primary); }

/* Layout grids */
.modern-split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.grid-col { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.drop-zone-wrapper { height: 44px; display: flex; align-items: center; justify-content: center; }
.drop-zone { border: 2px dashed var(--border-color); border-radius: var(--radius-md); text-align: center; color: var(--text-secondary); font-size: 13px; font-weight: bold; cursor: pointer; transition: all 0.2s ease; background: var(--surface-dark); width: 100%; }
.drop-zone:hover { border-color: var(--accent-primary); color: var(--text-primary); background: rgba(47, 129, 247, 0.05); }
.log-area { margin-top: 15px; padding: 10px; background: var(--surface-dark); border: 1px solid var(--border-color); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 12px; height: 80px; overflow-y: auto; color: var(--text-secondary); }

/* 🚀 PREMIUM BUTTONS (Now applied to toolbars in workspace/notes too!) */
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 5px; }
.action-row button, .editor-toolbar button {
    padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05); background: var(--surface-light); color: var(--text-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.action-row button:hover, .editor-toolbar button:hover { 
    transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.15); 
    filter: brightness(1.15); border-color: rgba(255, 255, 255, 0.1); 
}
.action-row button:active, .editor-toolbar button:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

.btn-clear { background: transparent !important; color: var(--color-danger) !important; border: 1px solid rgba(248, 81, 73, 0.3) !important; box-shadow: none !important; }
.btn-clear:hover { background: rgba(248, 81, 73, 0.1) !important; border-color: var(--color-danger) !important; }

/* 🚀 VAULT MODAL FIX */
.modal-overlay { display: none; position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.7); z-index: 10000; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.modal-content { background: var(--surface-dark); padding: 25px; border-radius: var(--radius-lg); border: 1px solid var(--border-color); width: 90%; max-width: 500px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 15px; }

/* 🚀 HEADER DROPDOWN MENU & BUTTONS */
.header-actions { display: flex; gap: 8px; align-items: center; }
.header-btn { 
    background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); 
    padding: 8px 14px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; 
    cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; height: 36px;
}
.header-btn:hover { background: var(--surface-light); filter: brightness(1.1); transform: translateY(-1px); }

/* The invisible hover bridge ensures the menu never collapses */
.dropdown-wrapper { position: relative; display: inline-block; padding-bottom: 12px; margin-bottom: -12px; }
.dropdown-menu {
    position: absolute; top: 100%; right: 0; margin-top: 0;
    background: var(--surface-dark); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex; flex-direction: column; gap: 4px; padding: 8px;
    opacity: 0; pointer-events: none; transform: translateY(-5px); transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000; min-width: 180px;
}
.dropdown-wrapper:hover .dropdown-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.dropdown-link {
    text-decoration: none; color: var(--text-primary); padding: 10px 15px;
    border-radius: 4px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 10px; transition: 0.2s;
}
.dropdown-link:hover { background: var(--surface-light); color: var(--accent-primary); padding-left: 20px; }

/* Mobile Overrides */
@media screen and (max-width: 768px) {
    .header-actions { flex-wrap: wrap; justify-content: flex-end; }
    .dropdown-menu { right: auto; left: 0; } /* Prevents menu from going off-screen */
    
    .tab-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; width: 100%; gap: 8px; }
    .tab-btn { flex-shrink: 0; white-space: nowrap; }
    
    .modern-split-grid { display: flex; flex-direction: column; }
    .mobile-order-1 { order: 1; } .mobile-order-2 { order: 2; } .mobile-order-3 { order: 3; } .mobile-order-4 { order: 4; }
    
    .floating-nav { bottom: 20px; left: 20px; }
    .fab-btn { width: 50px; height: 50px; font-size: 20px; }
}