@import url('https://fonts.googleapis.com/css2?family=Space+Mono&display=swap');

/* Modernized Code4 Academy stylesheet */
:root{
  --bg-1:#071a2b; /* deep navy */
  --bg-2:#0b63b7; /* brand blue */
  --accent:#ffb400; /* yellow */
  --card:#ffffff;
  --muted:rgba(255,255,255,0.88);
  --glass:rgba(255,255,255,0.06);
  --max-width:1180px;
  --shadow-lg:0 20px 45px rgba(2,12,27,0.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body{font-family:'Poppins',system-ui,Segoe UI,Roboto,Arial,Helvetica,sans-serif;margin:0;color:#fff;line-height:1.5;-webkit-font-smoothing:antialiased;background:
  linear-gradient(180deg, rgba(7,26,43,0.88), rgba(11,99,183,0.60)),
  url('assets/images/arian-darvishi-wh-RPfR_3_M-unsplash.jpg') center/cover no-repeat fixed}

/* subtle code-grid overlay */
body::after{content:"";position:fixed;inset:0;pointer-events:none;background-image:repeating-linear-gradient(0deg,rgba(255,255,255,0.01) 0 1px,transparent 1px 40px),repeating-linear-gradient(90deg,rgba(255,255,255,0.01) 0 1px,transparent 1px 40px);opacity:0.08}
.container{max-width:var(--max-width);margin:0 auto;padding:36px 28px}

/* Header */
header{display:flex;align-items:center;justify-content:space-between;padding:8px 0;gap:18px}
.brand{display:flex;align-items:center;gap:16px}
.logo{width:100px;height:100px;border-radius:14px;display:flex;align-items:center;justify-content:center;color:var(--bg-2);font-weight:900;font-size:20px;box-shadow:var(--shadow-lg);overflow:hidden}
.logo img{width:88px;height:88px;display:block;border-radius:10px;object-fit:cover}
h1{font-size:22px;margin:0}
.tag{color:var(--muted);font-weight:600;font-size:13px}

/* Brand heading color parts: CODE (blue), 4 (red), ACADEMY (white) */
.brand h1 span{display:inline-block}
.brand-code{color:var(--bg-2);font-weight:900;text-transform:none}
.brand-4{color:#ff3b30;font-weight:900;margin:0}
.brand-academy{color:#ffffff;font-weight:800;text-transform:none}

/* Code vibe elements */
.code-badge{display:inline-flex;align-items:center;gap:8px;background:rgba(255,255,255,0.06);padding:6px 10px;border-radius:999px;font-family:'Space Mono',ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:700;color:#fff;font-size:13px;border:1px solid rgba(255,255,255,0.04)}
.code-badge .bracket{color:var(--accent);font-weight:900}

.monospace{font-family:'Space Mono',ui-monospace,SFMono-Regular,Menlo,monospace}

.terminal-card{background:#011627;color:#d6deeb;padding:16px;border-radius:12px;font-family:'Space Mono',monospace;font-size:14px;box-shadow:0 8px 30px rgba(2,12,27,0.45)}
.terminal-top{display:flex;gap:8px;margin-bottom:8px;align-items:center}
.dot{width:10px;height:10px;border-radius:50%}
.dot.red{background:#ff5f56}
.dot.yellow{background:#ffbd2e}
.dot.green{background:#27c93f}

.code-sample pre{margin:0;white-space:pre-wrap;word-break:break-word}
.code-sample .kw{color:#ffb400;font-weight:700} /* keywords - warm accent */
.code-sample .fn{color:#6ad3b8} /* functions - soft teal */
.code-sample .str{color:#9be7ff} /* strings - soft cyan */
.code-sample .num{color:#ffd580} /* numbers - warm */
.code-sample .cm{color:#6b7b88;font-style:italic} /* comments - muted gray-blue */

.cursor{display:inline-block;width:8px;height:18px;background:#fff;margin-left:6px;animation:blink 1s steps(2,end) infinite;vertical-align:middle;border-radius:2px}
@keyframes blink{50%{opacity:0}}

/* Navigation */
.nav{display:flex;align-items:center;gap:12px}
.nav .menu-toggle{display:none;background:transparent;border:2px solid rgba(255,255,255,0.06);color:#fff;padding:8px 10px;border-radius:8px}
.nav-links{display:flex;gap:10px;align-items:center}
.nav-links a{color:#fff;text-decoration:none;padding:9px 12px;border-radius:8px;font-weight:600;transition:all .18s}
.nav-links a:hover{background:rgba(255,255,255,0.04);transform:translateY(-2px)}
.btn-primary{display:inline-flex;align-items:center;gap:10px;background:linear-gradient(90deg,var(--accent),#ff9f00);color:#07203a;padding:12px 18px;border-radius:12px;font-weight:800;box-shadow:0 14px 30px rgba(255,180,0,0.12),0 6px 18px rgba(2,12,27,0.28);transform:translateZ(0)}
.btn-primary:hover{transform:translateY(-3px) scale(1.01)}
.btn-primary:active{transform:translateY(-1px) scale(.995)}
.btn-primary .icon{width:18px;height:18px;display:inline-block;flex:0 0 18px}
.btn-primary.pulse{animation:cta-pulse 2.2s infinite}
@keyframes cta-pulse{0%{box-shadow:0 10px 30px rgba(255,180,0,0.07)}50%{box-shadow:0 22px 50px rgba(255,180,0,0.12)}100%{box-shadow:0 10px 30px rgba(255,180,0,0.07)}}
.btn-primary{will-change:transform,opacity}
.btn-primary.entrance{animation:cta-entrance 700ms cubic-bezier(.2,.9,.2,1) both}
@keyframes cta-entrance{0%{opacity:0;transform:translateY(18px) scale(.98)}100%{opacity:1;transform:translateY(0) scale(1)}}

@media(max-width:900px){
  .hero{flex-direction:column;align-items:flex-start}
  .hero h2{font-size:32px}
  .hero-right{width:100%;order:2}
  .hero-left{order:1}
  .btn-row{margin-top:8px}
}

/* Mobile CTA full-width */
@media(max-width:480px){
  .btn-row a.btn-primary{width:100%;justify-content:center;padding:14px}
  .btn-row a.btn-ghost{width:100%;justify-content:center}
}
.btn-ghost{background:transparent;border:2px solid rgba(255,255,255,0.08);padding:8px 12px;border-radius:10px;color:#fff}

/* Hero */
.hero{display:flex;gap:36px;align-items:center;padding:32px 0}
.hero-left{flex:1;padding-right:12px}
.hero h2{font-size:44px;margin:0 0 12px;line-height:1.04}
.hero p{margin:0 0 18px;color:var(--muted);max-width:58ch}
.btn-row{display:flex;gap:12px;flex-wrap:wrap}

.hero-right{flex:0 0 340px;display:flex;justify-content:flex-end;align-items:flex-start}
.hero .card{padding:20px;border-radius:14px;background:linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.03));box-shadow:0 8px 30px rgba(2,12,27,0.28)}

/* Cards / Grid */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px;margin-top:28px}
.card{background:var(--glass);padding:20px;border-radius:14px;backdrop-filter:blur(6px)}
.card h3{margin:0 0 8px}
.muted{color:var(--muted)}

/* Course card icon layout */
.card-head{display:flex;align-items:center;gap:14px;margin-bottom:8px}
.course-icon{width:56px;height:56px;flex:0 0 56px;border-radius:10px;background:rgba(255,255,255,0.03);display:flex;align-items:center;justify-content:center}
.course-icon svg{width:28px;height:28px;display:block;fill:currentColor;color:var(--accent)}
.card .card-head h3{margin:0}

section{padding:28px 0}
.center{text-align:center}

/* Registration (dark glass style) */
#register{background:linear-gradient(180deg, rgba(2,12,27,0.72), rgba(2,12,27,0.56));color:var(--muted);padding:24px;border-radius:16px;border:1px solid rgba(255,255,255,0.04);backdrop-filter:blur(8px)}
#register label{display:block;margin:10px 0 6px;font-size:14px;color:rgba(255,255,255,0.92)}
#register input,#register select{width:100%;padding:12px;border-radius:10px;border:1px solid rgba(255,255,255,0.08);font-size:15px;background:rgba(255,255,255,0.03);color:#fff}
#register input::placeholder,#register select::placeholder{color:rgba(255,255,255,0.6)}
#register input:focus,#register select:focus{outline:none;border-color:rgba(255,255,255,0.18);box-shadow:0 8px 30px rgba(2,12,27,0.5)}
#register .send-wpp{background:var(--bg-2);color:#fff;border:none;margin-top:12px;padding:12px;border-radius:10px;cursor:pointer;font-weight:800}
#register .send-wpp:hover{opacity:0.98;transform:translateY(-1px)}

/* Global select styling: improve dark-theme dropdown appearance */
select{
  background:rgba(255,255,255,0.03);
  color:#fff;
  border:1px solid rgba(255,255,255,0.08);
  padding:10px 12px;
  border-radius:10px;
  -webkit-appearance:none;
  appearance:none;
}
select:focus{outline:none;border-color:rgba(255,255,255,0.18);box-shadow:0 8px 30px rgba(2,12,27,0.5)}
select option{background-color:var(--bg-1);color:#fff}
/* On some platforms the native options list can still be light — this helps where supported */
select::-ms-expand{display:none}

.register-title{color:#fff;margin-top:0}
.register-sub{color:rgba(255,255,255,0.9)}

.contact-card{background:rgba(255,255,255,0.03);padding:16px;border-radius:12px;color:var(--muted)}
.contact-card a{color:var(--accent)}

/* Ensure regular links inside cards use the site's accent color
  (fixes blue default mailto / external links in contact page) */
.card a{color:var(--accent);text-decoration:none}
.card a:hover{opacity:0.95}
/* WhatsApp link style for contact areas */
.whatsapp-link{display:inline-flex;align-items:center;gap:8px;color:#25D366;font-weight:700;text-decoration:none;padding:6px 8px;border-radius:8px}
.whatsapp-link, .whatsapp-link:visited, .whatsapp-link:active{color:#25D366 !important}
.whatsapp-link .icon{width:18px;height:18px;flex:0 0 18px}
.whatsapp-link:hover{opacity:0.95;transform:translateY(-1px)}
.whatsapp-link span{color:inherit}

footer{padding:22px 0;color:var(--muted);text-align:center}

/* subtle animations */
.card, .btn, .logo{transition:all .18s ease}

/* Responsive */
@media(max-width:900px){
  .hero{flex-direction:column;align-items:flex-start}
  .hero h2{font-size:32px}
}

@media(max-width:720px){
  .container{padding:20px}
  .nav .menu-toggle{display:block}
  /* Mobile navigation panel */
  .nav-links{display:none;position:absolute;top:72px;right:16px;flex-direction:column;background:linear-gradient(180deg,rgba(7,26,43,0.98),rgba(11,99,183,0.98));padding:8px;border-radius:10px;box-shadow:var(--shadow-lg);min-width:200px}
  .nav-links a{display:block;padding:12px 14px;border-radius:8px}
  .nav-links a.btn-primary{margin:6px 8px}
  body.nav-open .nav-links{display:flex}
  .logo{width:80px;height:80px}
}

@media(max-width:480px){
  .hero h2{font-size:24px}
}

/* Small / medium phones: stack hero CTAs and improve tap targets */
@media(max-width:720px){
  .btn-row{flex-direction:column;align-items:stretch}
  .btn-row a{width:100%}
  .btn, .btn-ghost{padding:12px 14px}
}

@media(max-width:480px){
  .project-gallery .thumb{width:56px;height:44px}
  .project-main{height:160px}
}

/* Projects grid */
.projects-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:18px;margin-top:20px}
.project-card{display:flex;flex-direction:column;gap:12px;align-items:flex-start}
.project-thumb{width:100%;height:160px;overflow:hidden;border-radius:10px;background:rgba(0,0,0,0.06)}
.project-thumb img{width:100%;height:100%;object-fit:cover;display:block}

/* School Portal gallery */
.project-school-portal{display:grid;grid-template-columns:360px 1fr;gap:18px;align-items:start}
.project-main{height:220px;overflow:hidden;border-radius:12px}
.project-main img{width:100%;height:100%;object-fit:cover;display:block}
.project-info{display:flex;flex-direction:column}
.project-gallery{display:flex;gap:10px;margin-top:12px}
.project-gallery .thumb{width:72px;height:56px;display:block;border-radius:8px;overflow:hidden;flex:0 0 72px;border:2px solid rgba(255,255,255,0.04)}
.project-gallery .thumb img{width:100%;height:100%;object-fit:cover;display:block}

/* spacing for project CTA so it doesn't touch thumbnails */
.project-cta{margin-top:14px}

@media(max-width:900px){
  .project-cta{margin-top:12px}
}

@media(max-width:900px){
  .project-school-portal{grid-template-columns:1fr;}
  .project-main{height:180px}
}
/* small spacing helper for specific pseudocode cards */
.terminal-card.pseudo-margin{margin-top:32px}
@media(max-width:900px){
  .terminal-card.pseudo-margin{margin-top:20px}
}
/* Utility and layout for register area and small components */
.badge-row{margin:10px 0 14px}
.hero-illustration{width:320px;max-width:100%;border-radius:12px;box-shadow:0 10px 30px rgba(2,12,27,0.28);display:block}

@media(max-width:900px){
  .hero-right{flex:1;order:2;justify-content:center}
  .hero-illustration{width:100%;max-width:100%}
}
.spacer{height:12px}

.register-grid{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;flex-wrap:wrap}
.register-main{flex:1;min-width:280px}
.register-side{width:320px;min-width:220px}

@media(max-width:720px){
  .register-grid{flex-direction:column}
  .register-side{width:100%;min-width:0}
}
/* Language Selection Modal */
.modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:1000}
.modal-overlay{position:absolute;inset:0;background:rgba(0,0,0,0.6);backdrop-filter:blur(4px)}
.modal-content{position:relative;background:var(--card);color:#333;border-radius:16px;padding:32px;max-width:600px;width:90%;max-height:80vh;overflow-y:auto;box-shadow:0 25px 50px rgba(0,0,0,0.35)}
.modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.modal-header h2{margin:0;color:#1a1a1a;font-size:24px}
.modal-close{background:none;border:none;font-size:32px;cursor:pointer;color:#666;padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center}
.modal-close:hover{color:#000}
.modal-subtitle{color:#666;margin:8px 0 24px;font-size:15px}
.language-options{display:flex;flex-direction:column;gap:12px}
.language-option{display:flex;align-items:center;gap:16px;padding:18px;border:2px solid #e0e0e0;border-radius:12px;text-decoration:none;color:inherit;transition:all 0.3s ease;cursor:pointer}
.language-option:hover{border-color:#0077cc;background:#f8f9fa}
.language-option.coming-soon{opacity:0.6;cursor:not-allowed}
.language-option.coming-soon:hover{border-color:#e0e0e0;background:transparent}
.lang-icon{width:50px;height:50px;display:flex;align-items:center;justify-content:center;background:#f0f0f0;border-radius:10px;flex-shrink:0}
.language-option:hover .lang-icon{background:#e3f2fd}
.lang-icon svg{width:28px;height:28px;color:#0077cc}
.lang-info{flex:1}
.lang-info h3{margin:0;color:#1a1a1a;font-size:16px;font-weight:600}
.lang-info p{margin:4px 0 0;color:#999;font-size:13px}
.arrow{font-size:20px;color:#0077cc;transition:transform 0.3s ease}
.language-option:hover .arrow{transform:translateX(4px)}
.badge{background:#ffd700;color:#000;padding:4px 10px;border-radius:999px;font-size:11px;font-weight:600;white-space:nowrap}

@media(max-width:480px){
  .modal-content{padding:24px;width:95%}
  .modal-header h2{font-size:20px}
  .language-option{padding:14px;gap:12px}
  .lang-icon{width:44px;height:44px}
  .lang-icon svg{width:24px;height:24px}
}

/* Back to top button */
.back-to-top{display:none;position:fixed;bottom:24px;right:24px;z-index:230;background:var(--accent);color:#000;border:0;border-radius:50%;width:50px;height:50px;cursor:pointer;font-size:1.5rem;box-shadow:0 4px 12px rgba(0,0,0,0.25);transition:all 200ms ease;align-items:center;justify-content:center;font-weight:bold}
.back-to-top.show{display:flex}
.back-to-top:hover{transform:translateY(-4px);box-shadow:0 6px 16px rgba(0,0,0,0.35)}
.back-to-top:active{transform:translateY(-2px)}