* {
    padding: 0;
    margin: 0;
    font-family: 'Times New Roman', Times, serif;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #22438C;
    --accent: #5865F2;
}

/* 2. NAVBAR (IDENTICAL EVERYWHERE) */
ul {
    list-style: none;
    background: var(--primary);
    width: 100vw;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

ul li {
    display: inline-block;
    position: relative;
}

ul li a {
    display: block;
    padding: 20px 30px;
    color: #FFF;
    text-decoration: none;
    text-align: center;
    font-size: 20px;
}

/* DROPDOWN */
ul li ul.dropdown {
    width: 250px;
    background: var(--primary);
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 999;
    display: none;
    margin-top: 2px;
}

ul li:hover > ul.dropdown {
    display: block !important;
}

ul li ul.dropdown li {
    display: block;
    border-bottom: 1px solid #1a365d;
}

ul li ul.dropdown li a {
    padding: 15px 20px;
    font-size: 16px;
    text-align: left;
}

ul li ul.dropdown li:hover > ul.dropdown {
    display: block !important;
}

ul li ul.dropdown li ul.dropdown {
    left: 250px;
    top: 0;
}

ul li a:hover, ul li ul.dropdown li a:hover {
    background: #112C66;
}

/* 3. MAIN PAGE (100% ORIGINAL LAYOUT) */
.tutorials {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    padding: 4rem 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.tutorials h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(34,67,140,0.2);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 32px 64px rgba(0,0,0,0.15);
    border-color: rgba(34,67,140,0.4);
}

.card h3 { 
    font-size: 1.5rem; 
    margin: 1rem 0 0.5rem 0;
    color: #1e293b;
}

.card p { 
    color: #64748b; 
    font-size: 0.95rem;
    margin: 0;
}

.card span { 
    color: var(--primary);
    font-weight: 600;
}

.cube-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
}

.charity-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* 4. TUTORIAL PAGE (NEW FEATURES ONLY) */
.progress-nav, .progress-tracker {
    display: flex;
    gap: 1rem;
    padding: 2rem;
    background: linear-gradient(90deg, #f0f9ff, #e0f2fe);
    border-radius: 16px;
    margin: 2rem 0;
    overflow-x: auto;
}

.step {
    padding: 0.75rem 1.5rem;
    background: white;
    border-radius: 25px;
    border: 2px solid #cbd5e1;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.step.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.hero-video {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

.hero-video h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.hero-video p {
    font-size: 1.2rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-video iframe {
    width: 100%;
    max-width: 560px;
    height: 315px;
    border-radius: 16px;
    border: none;
    box-shadow: 0 16px 40px rgba(0,0,0,0.15);
}

.learn-step {
    background: white;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    margin-bottom: 3rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.learn-step:hover {
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

.step-header {
    background: linear-gradient(135deg, var(--primary) 0%, #112C66 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-number {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
}

.step-header h2 {
    margin: 0;
    font-size: 1.5rem;
    flex: 1;
}

.est-time {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.step-body {
    padding: 2.5rem;
    display: grid;
    gap: 2rem;
    grid-template-columns: 300px 1fr;
}

.cube-visual {
    position: relative;
}

.cube-visual img, .case-card img, .video-thumb img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.goal-state {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.instructions {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 16px;
    border-left: 4px solid #3b82f6;
    margin-bottom: 1.5rem;
}

.instructions h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.instructions ol {
    padding-left: 1.5rem;
    margin-top: 1rem;
}

.instructions li {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.algorithm, .notation-code {
    background: #1e293b;
    color: #60a5fa;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.case-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.case-card h4 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.video-thumb {
    display: block;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
    text-decoration: none;
}

.video-thumb:hover {
    transform: translateY(-4px);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(34, 67, 140, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    transition: all 0.3s ease;
}

.video-thumb:hover .play-icon {
    background: var(--primary);
    transform: translate(-50%, -50%) scale(1.1);
}

.notation {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.notation h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* 5. COMPLETE FOOTER (PIXEL PERFECT) */
footer {
    position: static;
    background: #140b5c;
    width: 100%;
    margin-top: 50px;
}

footer::before {
    content: '';
    position: absolute;
    left: 0;
    top: 100px;
    height: 1px;
    width: 100%;
    background: #AFAFB6;
}

footer .content {
    background: #140b5c !important;
    max-width: 1250px;
    margin: auto;
    padding: 30px 40px 40px 40px;
}

footer .content .top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 50px;
}

.content .top .logo-details {
    color: #fff;
    font-size: 30px;
}

.content .top .media-icons {
    display: flex;
}

.content .top .media-icons a{
    height: 40px;
    width: 40px;
    background: #140b5c;
    margin: 0 8px;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    color: #fff;
    font-size: 17px;
    text-decoration: none;
}

.top .media-icons a:nth-child(1){
    background: #4267B2;
}
.top .media-icons a:nth-child(1):hover{
    color: #4267B2;
    background: #fff;
}
.top .media-icons a:nth-child(2){
    background: #1DA1F2;
}
.top .media-icons a:nth-child(2):hover{
    color: #1DA1F2;
    background: #fff
}
.top .media-icons a:nth-child(3){
    background: #E1306C;
}
.top .media-icons a:nth-child(3):hover{
    color: #E1306C;
    background: #fff
}
.top .media-icons a:nth-child(4){
    background: #FF0000;
}
.top .media-icons a:nth-child(4):hover{
    color: #FF0000;
    background: #fff
}
.top .media-icons a:nth-child(5){
    background: #5865F2;
}
.top .media-icons a:nth-child(5):hover{
    color: #5865F2;
    background: #fff
}

footer .content .link-boxes {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

footer .content .link-boxes .bbbox {
    background: #140b5c;
    width: calc(100% / 5 - 10px);
}

.content .link-boxes .bbbox .link_name {
    color: #fff;
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 10px;
    position: relative;
}

.link-boxes .bbbox .link_name::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 35px;
    background: #fff;
}

.content .link-boxes .bbbox li {
    margin: 6px 0;
    list-style: none;
}

.content .link-boxes .bbbox li a{
    font-size: 14;
    font-weight: 300;
    color: #fff;
    opacity: 0.8;
    text-decoration: none;
}

.content .link-boxes .bbbox li a:hover {
    opacity: 1;
    text-decoration: underline;
}

.content .link-boxes .input-box {
    margin-right: 55px;
}

.link-boxes .input-box input {
    height: 40px;
    width: calc(100% + 55px);
    outline: none;
    border: 2px solid #AFAB;
    background: #140B5C;
    border-radius: 4px;
    padding: 0 15px;
    font-size: 15px;
    color: #fff;
    margin-top: 5px;
}

.link-boxes .input-box input::placeholder {
    color: #AFAFB6;
    font-size: 16px;
}

.link-boxes .input-box input[type="button"] {
    background: #fff;
    color: #140B5C;
    border: none;
    font-size: 18px;
    font-weight: 500;
    margin: 4px 0;
    opacity: 0.8;
    cursor: pointer;
    transition: all 0.4s ease;
}

.input-box input[type="button"]:hover {
    opacity: 1;
}

/* 6. RESPONSIVE */
@media (max-width: 768px) {
    .step-body {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    .step-header {
        padding: 1.25rem 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    .est-time {
        margin-left: 0;
    }
    .hero-video {
        padding: 2rem 1rem;
    }
    .case-grid {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 0 1rem;
    }
    .content .link-boxes {
        flex-direction: column;
    }
    .content .top {
        flex-direction: column;
        gap: 1rem;
    }
}
.video-thumb {
  display: inline-block;  /* SHRINKS to content */
  max-width: 320px;       /* Caps container width */
  width: 100%;
  line-height: 0;
}

.video-thumb img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  display: block;
}

.video-thumb .play-icon {
  width: 45px;
  height: 45px;
  font-size: 1.2rem;
}
.balisong-bank {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
  min-height: 100vh;
}

.hero-trick {
  text-align: center;
  padding: 3rem 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  margin-bottom: 3rem;
  backdrop-filter: blur(10px);
}

.hero-trick h1 {
  color: #ffffff;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1.5rem;
}

.video-thumb {
  position: relative;
  display: inline-block;
  margin: 1rem 0;
}

.video-thumb img {
  width: 100%;
  max-width: 400px;
  height: 225px;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0,212,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,212,255,0.4);
}

.trick-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.trick-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.trick-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.4);
  border-color: rgba(0,212,255,0.3);
}

.trick-number {
  position: absolute;
  top: -10px;
  left: 20px;
  background: #00d4ff;
  color: #000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
}

.trick-card h3 {
  color: #ffffff;
  margin: 0 0 1rem 0;
  font-size: 1.8rem;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.steps span {
  color: #e0e0e0;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  border-left: 3px solid #00d4ff;
}

.practice {
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
}

/* MOBILE */
@media (max-width: 768px) {
  .balisong-bank {
    padding: 1rem;
  }
  
  .trick-card {
    padding: 1.5rem;
  }
}
/* FIXED Algorithm Cards */
.alg-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;      /* Centers notation */
    justify-content: space-between !important;
    height: 320px !important;            /* Taller for long algs */
    max-width: 380px !important;         /* Matches grid */
    width: 100% !important;
    overflow: hidden !important;         /* Locks black box inside */
    padding: 1.5rem !important;
    box-sizing: border-box !important;
    background: rgba(255,255,255,0.95) !important;
    border-radius: 24px !important;
}

.alg-card .notation-code {
    flex: 1 !important;                  /* Fills space smartly */
    max-width: 100% !important;
    min-width: 0 !important;             /* Shrinks to fit */
    
    /* Smart wrapping - short algs untouched */
    overflow-wrap: anywhere !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    
    /* Perfect centering + pro look */
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    margin: 0.5rem 0 !important;
    padding: 1rem 1.2rem !important;
    font-family: 'Courier New', monospace !important;
    font-size: 14px !important;          /* Readable */
    line-height: 1.4 !important;
    background: #1e293b !important;      /* Your black box */
    color: #60a5fa !important;
    border-radius: 12px !important;
}

/* Grid matches card width */
.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)) !important;
    align-items: stretch !important;
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)) !important;
    gap: 2.5rem !important;
}

/* Button row spacing */
.alg-card > div:last-child {
    margin-top: auto !important;
}
.card-grid {
    align-items: stretch !important;
}

.alg-card {
    height: auto !important;
    min-height: unset !important;
    display: block !important;  /* Natural flow */
}

.alg-card img {
    max-height: 70px !important;
    width: 100% !important;
    object-fit: contain !important;
    margin: 0.25rem 0 !important;
}

/* Buttons always stay at bottom of natural content */
.alg-card > *:last-child {
    margin-top: auto !important;
}

/* More Footer code about copyright */
footer .bottom-details {
    width: 100;
    background: #0F0844;
}
footer .bottom-details .bottom_text {
    max-width: 1250px;
    margin: auto;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
}
.bottom-details .bottom_text span,
.bottom-details .bottom_text a {
    font-size: 14;
    font-weight: 300;
    color: #fff;
    opacity: 0.8;
    text-decoration: none;
}
.bottom-details .bottom_text a:hover {
    opacity: 1;
}
.bottom-details .bottom_text a {
    font-size: 14;
    margin-right: 10px;
}
/*signup button */
.auth-section {
  text-align: center; 
  margin: 1.5rem 0; 
  padding: 1.5rem;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-radius: 16px; 
  border: 1px solid #475569;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.auth-btn, #auth-submit, #logout {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: none; 
  padding: 0.875rem 2rem; 
  border-radius: 12px;
  color: white; 
  font-weight: 600; 
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0.25rem;
  min-width: 140px;
}

.auth-btn:hover, #auth-submit:hover, #logout:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(59,130,246,0.4);
}

#auth-form input {
  display: block; 
  width: 100%; 
  max-width: 280px; 
  margin: 0.75rem auto;
  padding: 0.875rem 1rem; 
  border-radius: 10px; 
  border: 2px solid #475569;
  background: #0f172a; 
  color: #e2e8f0;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

#auth-form input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96,165,250,0.1);
}

#auth-form input::placeholder {
  color: #64748b;
}

#user-panel {
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 1rem;
  background: rgba(16,185,129,0.2);
  padding: 1rem; 
  border-radius: 12px;
  margin-top: 1rem;
}

#welcome-user {
  color: #10b981; 
  font-weight: 700; 
  font-size: 1.1rem;
}

#auth-form, #user-panel {
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* This is for the horizontal cube tutorial images */
.cubevis-steps {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 15px 0;
  position: relative; 
  min-width: fit-content;
  overflow-x: auto;     
}

.cubevis-steps img {
  width: 100px !important;
  height: 100px !important;
  flex-shrink: 0;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.cubevis-steps p {
  width: 100%;
  text-align: center;
  margin: 10px 0;
  font-weight: 500;
}
/*Side bar for timer and etc*/
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 270px;
    background: var(--color-bg-sidebar);
    border-right: 1px solid var(--color-bg-sidebar);
    box-shadow: 0 3px 9px var(--color-shadow);
}
.sidebar .sidebar-header {
    display: flex;
    padding: 20px 18px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border-hr);
}
.sidebar .sidebar-content {
    padding: 20px 18px;
    overflow: hidden auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-text-placeholder) transparent;
}