/* =====================================================
   CYBER SECURITY PASSWORD ANALYZER — STYLESHEET
   College of Engineering Technology | Cybersecurity Dept.
   ===================================================== */

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

:root {
  --bg:        #0a0f1e;
  --bg2:       #0d1526;
  --bg3:       #111d35;
  --card:      #0f1c30;
  --border:    #1a2d4a;
  --accent:    #00d4aa;
  --accent2:   #7c3aed;
  --accent3:   #f59e0b;
  --danger:    #ef4444;
  --warn:      #f97316;
  --ok:        #22c55e;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --font:      'Tajawal', sans-serif;
  --radius:    14px;
  --shadow:    0 8px 32px rgba(0,0,0,.5);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  direction: rtl;
}

/* =====================================================
   PRIVACY BANNER
   ===================================================== */
.privacy-banner {
  background: linear-gradient(135deg, rgba(0,212,170,.12), rgba(0,212,170,.06));
  border-bottom: 2px solid rgba(0,212,170,.4);
  padding: 14px 20px;
}
.privacy-banner-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
}
.privacy-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  background: rgba(0,212,170,.18); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.privacy-icon svg { width: 20px; height: 20px; }
.privacy-text {
  flex: 1; font-size: .88rem; line-height: 1.6;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline;
}
.privacy-text strong {
  color: var(--accent); font-size: .95rem; white-space: nowrap;
}
.privacy-text span { color: var(--text); }
.privacy-text em {
  font-style: normal; font-weight: 700;
  color: #fff; background: rgba(0,212,170,.2);
  padding: 1px 6px; border-radius: 4px;
}
.privacy-close {
  background: transparent; border: 1px solid rgba(0,212,170,.3);
  color: var(--muted); width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; font-size: .75rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.privacy-close:hover { border-color: var(--accent); color: var(--accent); }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent2); border-radius: 3px; }

/* ---- LAYOUT ---- */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* =====================================================
   HEADER
   ===================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,15,30,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 16px;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.college-logo { width: 46px; height: 46px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-sup   { font-size: .68rem; color: var(--accent2); font-weight: 600; letter-spacing: .03em; opacity: .85; }
.brand-title { font-size: .95rem; font-weight: 700; color: var(--accent); }
.brand-sub   { font-size: .72rem; color: var(--muted); }

.header-nav { display: flex; gap: 3px; flex-wrap: nowrap; }
.header-nav a {
  color: var(--muted); text-decoration: none;
  padding: 6px 10px; border-radius: 8px;
  font-size: .82rem; font-weight: 500; transition: all .2s; white-space: nowrap;
}
.header-nav a:hover  { color: var(--accent); background: rgba(0,212,170,.08); }
.header-nav a.nav-active {
  color: var(--accent); background: rgba(0,212,170,.12);
  border: 1px solid rgba(0,212,170,.28);
}

/* ── Hamburger Toggle ── */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; background: transparent; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; cursor: pointer; flex-shrink: 0;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--muted); border-radius: 2px; transition: all .3s;
}
.nav-toggle:hover span { background: var(--accent); }

/* =====================================================
   HERO
   ===================================================== */
.hero {
  position: relative; overflow: hidden;
  padding: 100px 0 80px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124,58,237,.18) 0%, transparent 70%);
}
.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; }
.shape {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .25;
}
.s1 { width: 400px; height: 400px; background: var(--accent2); top: -100px; right: -100px; }
.s2 { width: 300px; height: 300px; background: var(--accent);  bottom: -80px; left: -60px; }
.s3 { width: 200px; height: 200px; background: var(--accent3); top: 40%; left: 45%; }

.hero-content { position: relative; text-align: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,212,170,.1); border: 1px solid rgba(0,212,170,.3);
  color: var(--accent); padding: 6px 16px; border-radius: 100px;
  font-size: .82rem; font-weight: 600; margin-bottom: 28px;
}
.badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.4); }
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900; line-height: 1.2; margin-bottom: 20px;
  color: #fff;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-desc { max-width: 560px; margin: 0 auto 36px; color: var(--muted); font-size: 1.05rem; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), #00a884);
  color: #0a0f1e; font-family: var(--font); font-weight: 700;
  padding: 13px 32px; border-radius: 10px; border: none;
  cursor: pointer; font-size: .95rem; text-decoration: none;
  transition: all .25s; box-shadow: 0 4px 20px rgba(0,212,170,.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,212,170,.45); }
.btn-full { width: 100%; margin-top: 20px; }

.btn-ghost {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); font-family: var(--font); padding: 8px 20px;
  border-radius: 8px; cursor: pointer; font-size: .85rem;
  transition: all .2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); padding: 12px; border-radius: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s; flex-shrink: 0;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* =====================================================
   STATS BAR
   ===================================================== */
.stats-bar { background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 0; padding: 20px 0; flex-wrap: wrap;
}
.stat { text-align: center; padding: 0 40px; }
.stat-num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--muted); margin-top: 4px; display: block; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* =====================================================
   SECTIONS
   ===================================================== */
.section { padding: 80px 0; }
.section-dark { background: var(--bg2); }

.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 2rem; font-weight: 800; color: #fff; margin-bottom: 12px; }
.section-header p { color: var(--muted); max-width: 560px; margin: 0 auto; font-size: .95rem; }

/* =====================================================
   CHECKER CARD
   ===================================================== */
.checker-card, .breach-card, .generator-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

/* ---- INPUT ---- */
.input-group {
  position: relative; display: flex; align-items: center;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 10px; overflow: hidden; transition: border-color .2s;
}
.input-group:focus-within { border-color: var(--accent); }
.input-icon {
  padding: 0 14px; color: var(--muted); display: flex; align-items: center; flex-shrink: 0;
}
.input-icon svg { width: 18px; height: 18px; }

.password-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font); font-size: 1rem;
  padding: 14px 8px; direction: ltr; letter-spacing: .05em;
}
.password-input::placeholder { color: var(--muted); letter-spacing: 0; direction: rtl; }

.toggle-btn {
  background: transparent; border: none; color: var(--muted);
  padding: 0 14px; cursor: pointer; display: flex; align-items: center;
  transition: color .2s; flex-shrink: 0;
}
.toggle-btn svg { width: 18px; height: 18px; }
.toggle-btn:hover { color: var(--accent); }

/* ---- STRENGTH BAR ---- */
.strength-container { margin-top: 20px; }
.strength-bar-wrap {
  height: 8px; background: var(--bg3);
  border-radius: 100px; overflow: hidden; margin-bottom: 10px;
}
.strength-bar {
  height: 100%; width: 0%; border-radius: 100px;
  transition: width .5s cubic-bezier(.4,0,.2,1), background .3s;
}
.strength-info { display: flex; justify-content: space-between; align-items: center; }
.strength-label { font-weight: 700; font-size: .9rem; }
.crack-time { font-size: .8rem; color: var(--muted); }

/* strength colors */
.str-0 { background: var(--danger);  color: var(--danger);  }
.str-1 { background: var(--warn);    color: var(--warn);    }
.str-2 { background: var(--accent3); color: var(--accent3); }
.str-3 { background: #84cc16;        color: #84cc16;        }
.str-4 { background: var(--ok);      color: var(--ok);      }

/* ---- GAUGE ---- */
.score-section {
  margin-top: 28px;
  display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: center;
}
@media (max-width: 560px) { .score-section { grid-template-columns: 1fr; } }

.gauge-wrap { display: flex; justify-content: center; }
.gauge-svg { width: 200px; height: 120px; }
.gauge-bg   { stroke: var(--bg3); }
.gauge-fill { transition: stroke-dashoffset .7s cubic-bezier(.4,0,.2,1), stroke .3s; }
.gauge-score {
  font-family: var(--font); font-size: 2.2rem; font-weight: 900;
  fill: #fff; dominant-baseline: auto;
}
.gauge-label-text { font-family: var(--font); font-size: .7rem; fill: var(--muted); }

/* ---- CRITERIA GRID ---- */
.criteria-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.criterion {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; font-size: .85rem;
  transition: border-color .3s;
}
.criterion.pass { border-color: rgba(34,197,94,.3); }
.criterion.fail { border-color: rgba(239,68,68,.2); }
.crit-icon { width: 18px; height: 18px; flex-shrink: 0; }
.criterion.pass .crit-icon { color: var(--ok); }
.criterion.fail .crit-icon { color: var(--danger); }

/* ---- ANALYSIS GRID ---- */
.analysis-grid {
  margin-top: 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px;
}
.analysis-item {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
}
.analysis-item .a-label { font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
.analysis-item .a-value { font-size: 1.1rem; font-weight: 700; color: var(--accent); }

/* ---- SUGGESTIONS ---- */
.suggestions-box {
  margin-top: 24px; background: rgba(124,58,237,.08);
  border: 1px solid rgba(124,58,237,.25); border-radius: 10px; padding: 20px 24px;
}
.suggestions-box h4 { font-size: .9rem; color: var(--accent2); margin-bottom: 12px; font-weight: 700; }
.suggestions-box ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.suggestions-box li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: .88rem; color: var(--text);
}
.suggestions-box li::before {
  content: '→'; color: var(--accent2); flex-shrink: 0; font-weight: 700; margin-top: 1px;
}

/* =====================================================
   BREACH SECTION
   ===================================================== */
.breach-privacy-note {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,212,170,.06); border: 1px solid rgba(0,212,170,.2);
  border-radius: 8px; padding: 12px 16px;
  font-size: .82rem; color: var(--muted); margin-bottom: 20px;
}
.breach-privacy-note svg { color: var(--accent); flex-shrink: 0; }

.breach-input-row { display: flex; gap: 12px; align-items: stretch; }
.flex-1 { flex: 1; }

.breach-result {
  margin-top: 20px; border-radius: 10px; padding: 18px 22px;
  font-size: .95rem; font-weight: 600; display: flex; align-items: center; gap: 12px;
}
.breach-safe   { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.3);  color: #4ade80; }
.breach-danger { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: #f87171; }
.breach-result svg { width: 22px; height: 22px; flex-shrink: 0; }

/* =====================================================
   GENERATOR
   ===================================================== */
.gen-output-row {
  display: flex; gap: 10px; align-items: center;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 24px;
}
.gen-password-display {
  flex: 1; font-size: 1rem; font-family: 'Courier New', monospace;
  color: var(--accent); letter-spacing: .06em; word-break: break-all;
  direction: ltr; text-align: left;
}

.gen-settings { display: flex; flex-direction: column; gap: 20px; }

.setting-row { display: flex; flex-direction: column; gap: 8px; }
.setting-row label { font-size: .9rem; color: var(--muted); }
.setting-row label strong { color: var(--accent); }

.slider {
  -webkit-appearance: none; width: 100%; height: 6px;
  background: var(--bg3); border-radius: 100px; outline: none;
  border: 1px solid var(--border);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  background: var(--accent); border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 8px rgba(0,212,170,.4);
}

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.checkbox-label {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: .87rem; color: var(--text);
  user-select: none;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkmark {
  width: 18px; height: 18px; flex-shrink: 0;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 5px; position: relative; transition: all .2s;
}
.checkbox-label input:checked + .checkmark {
  background: var(--accent); border-color: var(--accent);
}
.checkbox-label input:checked + .checkmark::after {
  content: ''; position: absolute; left: 4px; top: 1px;
  width: 6px; height: 10px;
  border: 2px solid #0a0f1e;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

/* ---- HISTORY ---- */
.gen-history { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.gen-history h4 { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.gen-history ul { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.gen-history li {
  font-family: 'Courier New', monospace; font-size: .85rem;
  color: var(--muted); background: var(--bg3);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; direction: ltr;
}

/* =====================================================
   TIPS
   ===================================================== */
.tips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

.tip-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.tip-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0,212,170,.12);
}
.tip-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.tip-icon svg { width: 22px; height: 22px; }
.tip-icon-1 { background: rgba(0,212,170,.12);  color: var(--accent);  }
.tip-icon-2 { background: rgba(124,58,237,.12); color: var(--accent2); }
.tip-icon-3 { background: rgba(245,158,11,.12); color: var(--accent3); }
.tip-icon-4 { background: rgba(34,197,94,.12);  color: var(--ok);      }
.tip-icon-5 { background: rgba(239,68,68,.12);  color: var(--danger);  }
.tip-icon-6 { background: rgba(59,130,246,.12); color: #60a5fa;        }

.tip-card h3 { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 8px; }
.tip-card p  { font-size: .85rem; color: var(--muted); line-height: 1.65; }

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; text-align: center;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-logo  { width: 40px; height: 40px; object-fit: contain; }
.footer-sup   { font-size: .68rem; color: var(--accent2); font-weight: 600; letter-spacing: .03em; opacity: .85; }
.footer-title { font-size: .95rem; font-weight: 700; color: var(--accent); }
.footer-sub   { font-size: .78rem; color: var(--muted); }
.footer-note  { font-size: .8rem; color: var(--muted); max-width: 480px; line-height: 1.7; }
.footer-copy  { font-size: .75rem; color: #334155; }

/* =====================================================
   COPY TOAST
   ===================================================== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: #0a0f1e;
  padding: 10px 24px; border-radius: 100px;
  font-size: .88rem; font-weight: 700; opacity: 0;
  transition: all .3s; pointer-events: none; z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =====================================================
   TOP PAGE LOADER
   ===================================================== */
#pageLoader {
  position: fixed; top: 0; right: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 9999; transform-origin: right;
  animation: loaderAnim .8s ease-out forwards;
}
@keyframes loaderAnim {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .header-nav a { padding: 6px 8px; font-size: .78rem; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .header-nav {
    display: none; flex-direction: column; gap: 4px;
    position: absolute; top: 68px; right: 0; left: 0;
    background: rgba(10,15,30,.97); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 16px; z-index: 200;
  }
  .header-nav.open { display: flex; }
  .header-nav a { padding: 10px 14px; font-size: .9rem; border-radius: 8px; }
  .header-inner { position: relative; }
}

@media (max-width: 640px) {
  .checker-card, .breach-card, .generator-card { padding: 20px; }
  .options-grid { grid-template-columns: 1fr; }
  .stats-inner { gap: 20px; }
  .stat-divider { display: none; }
  .breach-input-row { flex-direction: column; }
  .score-section { grid-template-columns: 1fr; }
  .criteria-grid { grid-template-columns: 1fr; }
}
