/* =======================================================
   💎 KEYWORD DENSITY - BULLETPROOF RESPONSIVE MASTER
   ======================================================= */
:root {
    --primary: #2563eb;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --border: #e2e8f0;
    --dark: #0f172a;
}

/* 1. BASE WRAPPER (Fluid Width) */
.dw-saas-wrapper { 
    max-width: 1250px; 
    margin: 40px auto; 
    padding: 0 20px; 
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; 
    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; 
}

/* 2. HEADER */
.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; 
}

/* 3. MAIN GRID (The Magic Layout) */
.dw-main-grid { 
    display: grid; 
    grid-template-columns: 1fr 480px; /* Desktop: Content left, Dashboard right */
    gap: 30px; 
    align-items: start; 
}

/* 4. CARDS & UI ELEMENTS */
.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); 
    display: flex; justify-content: space-between; align-items: center; 
}
.dw-card-header h3 { font-size: 18px; font-weight: 800; margin: 0; color: var(--dark); }

/* Input Styling */
.dw-input { 
    width: 100% !important; height: 450px; padding: 25px; 
    border: none; font-size: 16px; line-height: 1.6; 
    outline: none; resize: none !important; box-sizing: border-box; 
    color: #334155;
}

/* Footer & Buttons */
.dw-editor-footer { padding: 15px 25px; background: #f8fafc; text-align: right; border-top: 1px solid var(--border); }
.dw-pill { background: #e2e8f0; padding: 6px 14px; border-radius: 100px; font-size: 13px; font-weight: 700; color: var(--dark); }

.dw-btn-ultimate { 
    background: var(--primary); color: #fff; border: none; 
    padding: 14px 35px; border-radius: 100px; font-weight: 800; 
    cursor: pointer; transition: 0.3s; font-size: 15px;
    box-shadow: 0 10px 20px rgba(37,99,235,0.2);
}
.dw-btn-ultimate:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(37,99,235,0.3); }

/* 5. TABLE & DASHBOARD LOGIC */
.dw-table-wrap { overflow-x: auto; max-height: 500px; overflow-y: auto; }
.dw-pro-table { width: 100%; border-collapse: collapse; min-width: 400px; }
.dw-pro-table th { 
    text-align: left; padding: 15px 25px; background: #f8fafc; 
    font-size: 11px; text-transform: uppercase; color: #64748b; 
    letter-spacing: 0.05em; position: sticky; top: 0; z-index: 10;
}
.dw-pro-table td { padding: 15px 25px; border-bottom: 1px solid #f1f5f9; font-size: 14px; font-weight: 600; color: #334155; }

/* Progress Bars */
.dw-density-bar-bg { width: 100%; height: 6px; background: #f1f5f9; border-radius: 10px; margin-top: 6px; overflow: hidden; }
.dw-density-bar { height: 100%; transition: width 0.5s ease; border-radius: 10px; }

/* Filters */
.dw-filter-group { display: flex; background: #f1f5f9; padding: 4px; border-radius: 10px; }
.dw-filter-btn { border: none; padding: 6px 15px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; color: #64748b; transition: 0.3s; background: transparent; }
.dw-filter-btn.active { background: #fff; color: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

/* Utilities */
.dw-hide { display: none; }
.dw-empty { padding: 100px 40px; text-align: center; color: #94a3b8; font-size: 15px; font-style: italic; }


/* =======================================================
   🛡️ EXPERT BREAKPOINTS (The Bulletproof Logic)
   ======================================================= */

/* 💻 LAPTOPS & SMALL DESKTOPS (1025px to 1200px) */
@media screen and (max-width: 1200px) {
    .dw-main-grid {
        grid-template-columns: 1fr 420px; /* Dashboard thoda chota */
        gap: 25px;
    }
}

/* 📲 TABLETS & IPADS (768px to 1024px) */
@media screen and (max-width: 1024px) {
    .dw-main-grid { 
        grid-template-columns: 1fr; /* Stack vertically */
    }

    /* 🔥 EXPERT ORDER: Pehle Editor, Niche Dashboard */
    .dw-editor-card { order: 1; }
    .dw-result-card { order: 2; margin-top: 10px; }

    .dw-input { height: 350px; } /* Height adjust for better UX */
}

/* 📱 LARGE PHONES (481px to 767px) */
@media screen and (max-width: 767px) {
    .dw-saas-header h1 { font-size: 32px; }
    
    .dw-card-header { flex-direction: column; gap: 15px; text-align: center; }
    
    .dw-editor-footer { text-align: center; }
    .dw-btn-ultimate { width: 100%; padding: 16px; font-size: 16px; }
}

/* 🤳 SMALL PHONES (320px to 480px) */
@media screen and (max-width: 480px) {
    .dw-saas-wrapper { padding: 0 10px; margin: 20px auto; }
    
    .dw-saas-header h1 { font-size: 26px; }
    
    .dw-card { border-radius: 16px; }
    .dw-card-header { padding: 15px; }
    
    .dw-input { padding: 15px; height: 250px; font-size: 15px; }
    
    .dw-pro-table th, .dw-pro-table td { padding: 12px 15px; } /* Tighter table spacing */
    
    .dw-empty { padding: 60px 20px; }
}