/* =======================================================
   💎 HREFLANG GENERATOR - ULTRA-PRO CSS (FIXED SCROLL)
   ======================================================= */
:root {
    --primary: #2563eb;
    --dark: #0f172a;
    --terminal-bg: #1e293b;
    --terminal-text: #a5b4fc;
    --terminal-highlight: #38bdf8;
    --border: #e2e8f0;
    --bg-light: #f8fafc;
}

.dw-saas-wrapper { max-width: 1250px; margin: 40px auto; padding: 0 20px; font-family: 'Plus Jakarta Sans', sans-serif; box-sizing: border-box; }
.dw-saas-wrapper * { box-sizing: border-box; }

.text-gradient { background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; }

.dw-saas-header { text-align: center; margin-bottom: 40px; }
.dw-saas-chip { display: inline-block; padding: 6px 16px; background: #eff6ff; color: var(--primary); border-radius: 100px; font-size: 12px; font-weight: 700; margin-bottom: 12px; letter-spacing: 0.5px; }

/* 🚀 MAIN GRID */
.dw-main-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: start; }

.dw-card { background: #fff; border-radius: 24px; border: 1px solid var(--border); box-shadow: 0 10px 40px rgba(0,0,0,0.04); overflow: hidden; }
.dw-card-header { padding: 20px 25px; border-bottom: 1px solid var(--border); background: var(--bg-light); }
.dw-card-header h3 { font-size: 18px; font-weight: 800; margin: 0; color: var(--dark); }

.dw-form-body { padding: 25px; }
.dw-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--dark); }
.dw-hint { font-size: 13px; color: #64748b; margin-top: 0; margin-bottom: 10px; }

.dw-input { 
    width: 100%; padding: 12px 15px; border-radius: 12px; border: 1px solid var(--border); 
    font-size: 14px; outline: none; transition: 0.3s; color: #334155; background: #fff; font-family: inherit;
}
.dw-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }
select.dw-input { height: 46px; padding: 0 15px; cursor: pointer; line-height: normal; }

/* Specific Components */
.dw-x-default-box { background: var(--bg-light); padding: 20px; border-radius: 16px; border: 1px solid var(--border); }
.dw-divider { border: 0; height: 1px; background: var(--border); margin: 30px 0; }
.dw-label-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.dw-badge { background: #eff6ff; color: var(--primary); padding: 4px 12px; border-radius: 100px; font-size: 12px; font-weight: 700; }

/* Dynamic Rows */
#hreflang-rows-container { display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }
.dw-dynamic-row { display: flex; gap: 10px; align-items: flex-end; background: #fff; padding: 15px; border-radius: 16px; border: 1px solid var(--border); transition: 0.3s; }
.dw-dynamic-row:hover { border-color: #cbd5e1; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.dw-row-inputs { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 10px; flex-grow: 1; }
.dw-input-group label { font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 5px; display: block; }

/* Delete Button */
.dw-btn-remove { 
    background: #fee2e2; color: #ef4444; border: none; width: 46px; height: 46px; 
    border-radius: 12px; cursor: pointer; display: flex; align-items: center; 
    justify-content: center; transition: 0.3s; font-size: 18px; font-weight: 900;
}
.dw-btn-remove:hover { background: #fca5a5; transform: scale(1.05); color: #b91c1c; }

.dw-btn-dashed { 
    width: 100%; padding: 15px; background: transparent; border: 2px dashed #cbd5e1; 
    border-radius: 16px; color: var(--primary); font-weight: 700; cursor: pointer; transition: 0.3s; font-size: 15px;
}
.dw-btn-dashed:hover { border-color: var(--primary); background: #eff6ff; }

/* 💻 TERMINAL PANEL */
.dw-terminal-panel { background: var(--terminal-bg); border-color: var(--dark); display: flex; flex-direction: column; height: 100%; position: sticky; top: 20px; }
.dw-terminal-header { padding: 15px 20px; background: rgba(0,0,0,0.3); display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
.dw-dots { display: flex; gap: 6px; }
.dw-dots span { width: 12px; height: 12px; border-radius: 50%; }
.dw-dots span:nth-child(1) { background: #ef4444; }
.dw-dots span:nth-child(2) { background: #eab308; }
.dw-dots span:nth-child(3) { background: #22c55e; }
.dw-terminal-title { flex: 1; text-align: center; color: #94a3b8; font-size: 13px; font-family: monospace; letter-spacing: 1px; }

/* 🔥 THE FIX: Terminal Window Scrollbar Added */
.dw-terminal-window { 
    padding: 25px; 
    flex-grow: 1; 
    max-height: 450px; /* Terminal window height lock */
    overflow-y: auto;  /* Vertical Scroll chalu */
}

/* Custom Pro Scrollbar for Terminal */
.dw-terminal-window::-webkit-scrollbar { width: 8px; }
.dw-terminal-window::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 4px; }
.dw-terminal-window::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
.dw-terminal-window::-webkit-scrollbar-thumb:hover { background: #64748b; }

#live-code-output { 
    margin: 0 !important; padding: 0 !important; background: transparent !important; 
    border: none !important; color: var(--terminal-text) !important; 
    font-family: 'Courier New', Courier, monospace; font-size: 14px; line-height: 1.8; 
    white-space: pre-wrap !important; word-wrap: break-word !important; 
}

/* Terminal Buttons */
.dw-terminal-actions { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; border-top: 1px solid rgba(255,255,255,0.05); }
.dw-terminal-actions button {
    border-radius: 12px !important; padding: 14px 10px !important; font-size: 15px !important; font-weight: 800 !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    width: 100% !important; height: 50px !important; margin: 0 !important; line-height: 1 !important; white-space: nowrap !important;
}
.dw-terminal-actions .dw-btn-secondary { background: rgba(255,255,255,0.1) !important; color: #fff !important; border: 1px solid rgba(255,255,255,0.2) !important; cursor: pointer; transition: 0.3s; }
.dw-terminal-actions .dw-btn-secondary:hover { background: rgba(255,255,255,0.2) !important; }
.dw-terminal-actions .dw-btn-ultimate { background: var(--primary) !important; color: #fff !important; border: none !important; cursor: pointer; transition: 0.3s; box-shadow: 0 10px 20px rgba(37,99,235,0.3) !important; }
.dw-terminal-actions .dw-btn-ultimate:hover { transform: translateY(-3px) !important; box-shadow: 0 15px 30px rgba(37,99,235,0.4) !important; }

/* =======================================================
   🛡️ HARDCORE MEDIA QUERIES (Mobile Fixes)
   ======================================================= */
@media (max-width: 1024px) {
    .dw-main-grid { grid-template-columns: 1fr; }
    .dw-terminal-panel { position: static; height: auto; min-height: 350px; }
}

@media (max-width: 768px) {
    .dw-saas-header h1 { font-size: 30px; }
    .dw-row-inputs { grid-template-columns: 1fr 1fr; }
    .dw-url-group { grid-column: span 2; } 
}

@media (max-width: 480px) {
    .dw-saas-wrapper { padding: 0 15px; margin: 20px auto; }
    .dw-form-body { padding: 20px 15px; }
    
    .dw-dynamic-row { flex-direction: column; align-items: stretch; position: relative; padding-top: 35px; }
    .dw-row-inputs { grid-template-columns: 1fr; }
    .dw-url-group { grid-column: span 1; }
    
    .dw-btn-remove { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; font-size: 14px; }
    
    .dw-terminal-actions { grid-template-columns: 1fr; }
}