/*Navigation Bar*/
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; font-family: "Times New Roman", Times, serif; }
body { min-height: 100vh; position: relative; overflow-x: hidden; }
::placeholder { font-family: "Times New Roman", Times, serif; }
.overlay { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.nav-bar { position: relative; z-index: 3; text-align: right; padding: 20px 40px; }
.nav-bar a { color: white; text-decoration: none; margin-left: 25px; font-weight: bold; font-size: 18px; }
.nav-bar a:hover { color: #932b2b; text-decoration: underline; }
.back-btn { display: inline-block; margin-top: 25px; padding: 10px 25px; border-radius: 8px; text-decoration: none; font-weight: bold; }

/* Background Images */
body.home-page {
    background: url("/static/images/spiderman.jfif") no-repeat center center fixed;
    background-size: cover;
}

body.profile-page {
    background: url("/static/images/parker.jfif") no-repeat center center fixed;
    background-size: cover;
}

body.works-page {
    background: url("/static/images/Minimalist.jpg") no-repeat center center fixed;
    background-size: cover;
}

body.contact-page {
    background: url("/static/images/Spidey.jfif") no-repeat center center fixed;
    background-size: cover;
}

body.area-page {
    background: url("/static/images/parker.jfif") no-repeat center center fixed;
    background-size: cover;
}

body.linklist-page {
    background: url("/static/images/gwen.jfif") no-repeat center center fixed;
    background-size: cover;
}

body.uppercase-page {
    background: url("/static/images/peter.jfif") no-repeat center center fixed;
    background-size: cover;
}

body.infix-page {
    background: url("/static/images/Stacy.jfif") no-repeat center center fixed;
    background-size: cover;
}
body.queue_de_que-page {
    background: url("/static/images/harry.jpg") no-repeat center center fixed;
    background-size: cover;
}
body.sorting-page {
    background: url("/static/images/black.jpg") no-repeat center center fixed;
    background-size: cover;
}
body.binarytree-page {
    background: url("/static/images/ben.jpg") no-repeat center center fixed;
    background-size: cover;
}

/* Index Style */
.home-page .overlay { background: linear-gradient(135deg, rgba(90, 0, 0, 0.65), rgba(180, 0, 0, 0.45)); }
.home-page .nav-bar { padding: 25px 50px; }
.home-page .nav-bar a { margin-left: 30px; text-shadow: 0 0 8px rgba(255, 60, 60, 0.6); transition: all 0.3s ease; }
.home-page .nav-bar a:hover { text-shadow: 0 0 15px rgb(170 48 48 / 0.93), 0 0 30px rgba(255, 50, 50, 0.5); }
.home-page .center-wrapper { position: relative; z-index: 2; display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 100px); padding: 20px; }
.home-page .hero-card { max-width: 650px; width: 100%; background: rgba(255, 245, 245, 0.92); border-radius: 24px; padding: 45px 40px; text-align: center; box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.3), 0 10px 40px rgba(120, 0, 0, 0.45), inset 0 0 25px rgba(255, 255, 255, 0.6); animation: fadeUp 1s ease forwards; opacity: 0; transform: translateY(25px); }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.home-page .profile-pic { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 4px solid #cc0000; box-shadow: 0 0 20px rgba(204, 0, 0, 0.5), 0 0 40px rgba(255, 50, 50, 0.3); margin-bottom: 25px; }
.home-page h1 { color: #990000; font-size: 38px; margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(150, 0, 0, 0.15); }
.home-page .subtitle { color: #770000; font-size: 18px; margin-bottom: 35px; font-style: italic; }
.home-page .btn-group { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.home-page .btn { padding: 14px 28px; border-radius: 12px; font-size: 17px; font-weight: bold; text-decoration: none; transition: all 0.3s ease; border: none; cursor: pointer; letter-spacing: 0.5px; }
.home-page .btn-light { background: linear-gradient(135deg, #e64444, #cc2222); color: white; box-shadow: 0 4px 15px rgba(204, 34, 34, 0.4); }
.home-page .btn-light:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 25px rgba(204, 34, 34, 0.5), 0 0 20px rgba(255, 50, 50, 0.35); }
.home-page .btn-dark { background: linear-gradient(135deg, #990000, #660000); color: white; box-shadow: 0 4px 15px rgba(102, 0, 0, 0.4); }
.home-page .btn-dark:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 25px rgba(102, 0, 0, 0.5), 0 0 20px rgba(180, 0, 0, 0.35); }
.home-page .btn-accent { background: linear-gradient(135deg, #cc1144, #aa0033); color: white; box-shadow: 0 4px 15px rgba(170, 0, 51, 0.4); }
.home-page .btn-accent:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 25px rgba(170, 0, 51, 0.5), 0 0 20px rgba(220, 20, 80, 0.35); }

/* Profile Style */
.profile-page { padding: 100px 30px 40px; }
.profile-page .overlay { background: rgba(90, 0, 0, 0.55); }
.profile-page .nav-bar { position: fixed; top: 0; right: 0; width: 100%; padding: 25px 50px; }
.profile-page .main-wrapper { position: relative; z-index: 2; display: flex; justify-content: center; align-items: flex-start; gap: 30px; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; }
.profile-page .card { background: rgba(255, 245, 245, 0.92); border-radius: 20px; padding: 35px 40px; box-shadow: 0 8px 32px rgba(120, 0, 0, 0.45); color: #660000; flex: 1; min-width: 400px; }
.profile-page .card h2 { color: #990000; font-size: 32px; padding-bottom: 10px; border-bottom: 2px solid #cc3333; margin-bottom: 15px; }
.profile-page .info-row { display: flex; margin: 14px 0; font-size: 18px; }
.profile-page .info-row strong { color: #990000; min-width: 110px; display: inline-block; }
.profile-page .divider-line { border-bottom: 1px solid #cc3333; margin: 10px 0; }
.profile-page h3 { color: #cc3333; margin: 25px 0 12px; font-size: 24px; }
.profile-page .card p { line-height: 1.7; font-size: 17px; text-align: justify; }
.profile-page .skills-list { list-style: none; line-height: 2; font-size: 17px; }
.profile-page .skills-list li::before { content: "✦"; color: #cc3333; margin-right: 10px; }
.profile-page .back-btn { background: #cc3333; color: white; font-size: 16px; }
.profile-page .back-btn:hover { background: #990000; }

/* Works Style */

.works-page { color: white; }
.works-page .overlay { background: rgba(120, 0, 0, 0.5); }
.works-container { position: relative; z-index: 2; max-width: 1500px; width: 96%; margin: 30px auto; text-align: center; padding: 20px 0; }
.works-main-title { color: #990000; font-size: 32px; margin: 0 0 8px; }
.works-subtitle { color: #cc6666; margin: 0; font-size: 16px; }
.works-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 25px; width: 100%; max-width: 1450px; margin: 0 auto; }
.work-card { display: flex; flex-direction: column; align-items: center; background: rgba(255, 255, 255, 0.9); border-radius: 16px; padding: 30px 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); color: #660000; text-align: center; min-width: 0; height: 100%; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.work-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35); }
.work-card h3 { color: #990000; margin: 0 0 15px; font-size: 19px; }
.work-card p { flex-grow: 1; font-size: 14px; line-height: 1.6; margin: 0 0 22px; color: #773333; }
.explore-btn { display: inline-block; background: #cc3333; color: white; padding: 10px 24px; border-radius: 20px; text-decoration: none; font-weight: bold; font-size: 14px; margin-top: auto; transition: background 0.2s ease, transform 0.2s ease; }
.explore-btn:hover { background: #b30000; transform: scale(1.05); }
.back-btn { display: inline-block; margin-top: 35px; padding: 12px 30px; background: transparent; color: #cc3333; border: 2px solid #cc3333; border-radius: 8px; text-decoration: none; font-weight: bold; transition: all 0.2s ease; }
.back-btn:hover { background: #cc3333; color: white; }
.works-header-box { background: rgba(255, 255, 255, 0.95); max-width: 600px; margin: 0 auto 35px; padding: 25px 30px; border-radius: 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
@media (max-width: 1000px) { .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .works-grid { grid-template-columns: 1fr; } .works-container { width: 94%; } }

/* Contact Style */
.contact-page { color: white; }
.contact-page .overlay { background: rgba(150, 0, 0, 0.55); }
.contact-page .container { position: relative; z-index: 2; max-width: 500px; margin: 60px auto; padding: 0 20px; }
.contact-page .card { background: rgba(255, 255, 255, 0.85); padding: 35px; border-radius: 16px; box-shadow: 0 8px 32px rgba(100, 0, 0, 0.3); text-align: center; color: #660000; }
.contact-page h2 { color: #990000; margin-top: 0; border-bottom: 2px solid #cc3333; padding-bottom: 10px; }
.contact-page .item { margin: 15px 0; padding: 15px; background: rgba(204, 51, 51, 0.15); border-radius: 8px; text-align: left; }
.contact-page strong { color: #990000; }
.contact-page .back-btn { background: #cc3333; color: white; }
.contact-page .back-btn:hover { background: #b30000; }
.contact-link { color: #990000; text-decoration: none; font-weight: bold; border-bottom: 1px solid transparent; transition: all 0.2s ease; }
.contact-link:hover { color: #cc3333; border-bottom: 1px solid #cc3333; }

/* Area Style */
.area-page { padding: 20px; color: white; display: flex; align-items: center; justify-content: center; min-height: 100vh; font-family: "Times New Roman", Times, serif; }
.area-page .overlay { background: rgba(120, 0, 0, 0.5); }
.area-page .nav-bar { position: fixed; top: 0; right: 0; }
.area-page .container { position: relative; z-index: 2; width: 95%; max-width: 1200px; margin: 90px auto 40px; }
.area-page .area-title { color: #990000; font-size: 32px; text-align: center; margin: 0 0 30px; }
.area-page .area-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px; align-items: stretch; }
.area-page .card { background: rgba(255, 255, 255, 0.9); border-radius: 20px; padding: 35px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); color: #660000; text-align: center; }
.area-page h2 { color: #990000; border-bottom: 2px solid #cc3333; padding-bottom: 15px; margin: 0 0 25px; text-align: center; font-size: 26px; }
.area-page h3 { color: #cc3333; margin: 20px 0 12px; text-align: center; font-size: 22px; }
.area-page label { display: block; margin: 15px 0 7px; font-weight: bold; text-align: left; }
.area-page input { width: 100%; padding: 13px; border: 2px solid #cc3333; border-radius: 8px; font-size: 16px; font-family: "Times New Roman", Times, serif; }
.area-page .btn, .area-page .btn-triangle { color: white; padding: 12px 25px; border: none; border-radius: 8px; font-size: 15px; font-weight: bold; cursor: pointer; margin-top: 20px; font-family: "Times New Roman", Times, serif; }
.area-page .btn { background: #cc3333; }
.area-page .btn:hover { background: #b30000; }
.area-page .btn-triangle { background: #990000; }
.area-page .btn-triangle:hover { background: #7a0000; }
.area-page .result-box { margin-top: 20px; padding: 15px; background: rgba(204, 51, 51, 0.15); border-radius: 8px; font-weight: bold; font-size: 17px; }
.area-page .back-btn { display: inline-block; margin-top: 30px; border: 2px solid #cc3333; color: #cc3333; }
.area-page .back-btn:hover { background: #cc3333; color: white; }
.area-page .divider { display: none; }
.area-page .area-actions { text-align: center; margin-top: 25px; }
@media (max-width: 768px) { .area-page .area-grid { grid-template-columns: 1fr; } .area-page .container { width: 95%; } .area-page .card { padding: 25px; } }
.area-page .area-title { background: rgba(255, 255, 255, 0.92); color: #990000; font-family: "Times New Roman", Times, serif; font-size: 32px; text-align: center; max-width: 600px; margin: 0 auto 35px; padding: 25px 30px; border-radius: 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }


/* Linklist Style */
.linklist-page { color: white; }
.linklist-page .overlay { background: rgba(120, 0, 0, 0.5); }
.linklist-page .container { position: relative; z-index: 2; max-width: 1050px; margin: 30px auto; padding: 0 20px; }
.linklist-page .card { background: rgba(255, 255, 255, 0.9); border-radius: 20px; padding: 35px; box-shadow: 0 8px 32px rgba(100, 0, 0, 0.4); color: #660000; }
.linklist-page h1 { color: #990000; margin-top: 0; border-bottom: 3px solid #cc3333; padding-bottom: 12px; text-align: center; }
.linklist-page .status-bar { background: rgba(204, 51, 51, 0.15); padding: 12px 16px; border-radius: 8px; margin: 10px 0 25px; color: #990000; text-align: center; }
.linklist-page .input-row { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-bottom: 25px; }
.linklist-page .input-group { display: flex; flex-direction: column; align-items: center; }
.linklist-page .input-group label { font-weight: bold; margin-bottom: 8px; font-size: 17px; }
.linklist-page .input-group input { padding: 10px; width: 220px; border: 2px solid #cc3333; border-radius: 8px; font-size: 16px; font-family: "Times New Roman", Times, serif; }
.linklist-page .btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 30px; }
.linklist-page .btn { padding: 12px 14px; border: none; border-radius: 8px; color: white; font-weight: bold; cursor: pointer; font-size: 15px; font-family: "Times New Roman", Times, serif; }
.linklist-page .btn.append, .linklist-page .btn.prepend { background: #c0392b; }
.linklist-page .btn.insertIdx { background: #e74c3c; }
.linklist-page .btn.search {background: rgb(200 16 16 / 0.93);}  .linklist-page .btn.search:hover {background: rgb(204 32 32 / 0.93);}
.linklist-page .btn.delVal, .linklist-page .btn.popHead, .linklist-page .btn.popTail, .linklist-page .btn.clear { background: #922b21; }
.linklist-page .btn.append:hover, .linklist-page .btn.prepend:hover { background: #a93226; }
.linklist-page .btn.insertIdx:hover { background: #c0392b; }
.linklist-page .btn.delVal:hover, .linklist-page .btn.popHead:hover, .linklist-page .btn.popTail:hover, .linklist-page .btn.clear:hover { background: #782121; }
.linklist-page .visual-title { font-size: 20px; font-weight: bold; margin-bottom: 12px; color: #990000; text-align: center; }
.linklist-page .list-display { background: linear-gradient(to right, #4d0000, #800000); border-radius: 12px; padding: 25px 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 60px; color: white; font-size: 20px; justify-content: center; }
.linklist-page .head-box { background: #ff3333; color: white; padding: 10px 20px; border-radius: 8px; font-weight: bold; border: 2px solid #ff6666; }
.linklist-page .node-box { background: #cc0000; color: white; padding: 10px 25px; border-radius: 8px; border: 2px solid #ff4444; }
.linklist-page .arrow { color: #ffcccc; font-weight: bold; }
.linklist-page .null-box { background: #660000; color: #ffcccc; padding: 10px 20px; border-radius: 8px; border: 2px solid #993333; }
.linklist-page .empty-text { color: #ffcccc; font-style: italic; }
.linklist-page .back-btn { border: 2px solid #cc3333; color: #cc3333; }
.linklist-page .back-btn:hover { background: #cc3333; color: white; }
.linklist-page .btn-row {display:flex; gap:10px; flex-wrap:nowrap; justify-content:center; margin-bottom:15px;}

/* Touppercase Style */
.uppercase-page { color: white; }
.uppercase-page .overlay { background: rgba(120, 0, 0, 0.5); }
.uppercase-page .container { position: relative; z-index: 2; max-width: 600px; margin: 60px auto; padding: 0 20px; box-sizing: border-box; }
.uppercase-page .card { background: rgba(255, 255, 255, 0.88); border-radius: 20px; padding: 40px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); color: #660000; text-align: center; }
.uppercase-page h2 { color: #990000; border-bottom: 3px solid #cc3333; padding-bottom: 12px; margin-top: 0; }
.uppercase-page label { display: block; margin: 20px 0 8px; font-weight: bold; text-align: left; }
.uppercase-page textarea { width: 100%; padding: 12px; border: 2px solid #cc3333; border-radius: 8px; font-size: 16px; box-sizing: border-box; font-family: "Times New Roman", Times, serif; }
.uppercase-page .btn { background: #cc3333; color: white; padding: 12px 30px; border: none; border-radius: 10px; font-weight: bold; font-size: 16px; cursor: pointer; margin: 20px 8px 0; }
.uppercase-page .btn:hover { background: #b30000; }
.uppercase-page .result-box { margin-top: 25px; padding: 20px; background: rgba(204, 51, 51, 0.15); border-radius: 10px; font-weight: bold; font-size: 18px; min-height: 40px; overflow-wrap: anywhere; }
.uppercase-page .back-btn { border: 2px solid #cc3333; color: #cc3333; }
.uppercase-page .back-btn:hover { background: #cc3333; color: white; }

/* Infix to Postfix Style */
body.infix-page{margin:0;min-height:100vh;padding:0;font-family:"Times New Roman",Times,serif;background-position:center;background-repeat:no-repeat;background-attachment:fixed;background-size:cover;position:relative;}
.infix-page .overlay{position:fixed;inset:0;background:rgba(120,0,0,0.30);z-index:0;pointer-events:none;}
.infix-page .nav-bar{position:relative;z-index:1;display:flex;justify-content:flex-end;align-items:center;gap:12px;padding:20px 40px;box-sizing:border-box;}
.infix-page .nav-bar a{color:white;text-decoration:none;font-weight:bold;font-size:17px;}
.infix-page .nav-bar a:hover{color:#ffcccc;}
.infix-page .container{position:relative;z-index:1;width:100%;max-width:600px;min-height:calc(100vh - 80px);margin:0 auto;padding:20px;box-sizing:border-box;display:flex;justify-content:center;align-items:center;}
.infix-page .main-card{width:100%;background:rgba(255,255,255,0.90);padding:30px 40px;border-radius:22px;box-shadow:0 8px 32px rgba(0,0,0,0.30);color:#660000;text-align:center;box-sizing:border-box;}
.infix-page h2{color:#990000;border-bottom:3px solid #cc3333;padding-bottom:12px;margin-top:0;margin-bottom:0;}
.infix-page .subtitle{font-style:italic;margin:5px 0 24px;}
.infix-page label{display:block;text-align:left;font-weight:bold;margin-bottom:8px;}
.infix-page input{width:100%;box-sizing:border-box;padding:12px;border:2px solid #cc3333;border-radius:9px;font-family:"Times New Roman",Times,serif;font-size:16px;background:rgba(255,255,255,0.90);color:#660000;}
.infix-page input:focus{outline:none;border-color:#990000;}
.infix-page textarea{width:100%;min-height:118px;box-sizing:border-box;padding:12px;border:2px solid #cc3333;border-radius:9px;font-family:"Times New Roman",Times,serif;font-size:16px;background:rgba(255,255,255,0.90);color:#660000;resize:vertical;}
.infix-page textarea:focus{outline:none;border-color:#990000;}
.infix-page .btn-group{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:10px;margin-top:16px;}
.infix-page .btn-convert,.infix-page .btn-clear{padding:11px 24px;border:none;border-radius:9px;font-weight:bold;font-family:"Times New Roman",Times,serif;font-size:15px;cursor:pointer;transition:background 0.2s ease;}
.infix-page .btn-convert{background:#cc3333;color:white;}
.infix-page .btn-convert:hover{background:#990000;}
.infix-page .btn-clear{background:#990000;color:white;}
.infix-page .btn-clear:hover{background:#660000;}
.infix-page .output-box{margin-top:22px;padding:15px;border-radius:9px;background:rgba(204,51,51,0.15);border:1px solid #cc3333;font-weight:bold;overflow-wrap:anywhere;text-align:left;}
.infix-page .back-btn{display:inline-block;margin-top:22px;padding:11px 24px;border:2px solid #990000;border-radius:9px;color:#990000;text-decoration:none;font-weight:bold;transition:background 0.2s ease,color 0.2s ease;}
.infix-page .back-btn:hover{background:#990000;color:white;}
@media (max-width:600px){
  .infix-page .nav-bar{flex-wrap:wrap;justify-content:center;gap:15px;padding:20px;}
  .infix-page .nav-bar a{font-size:16px;}
  .infix-page .container{width:100%;max-width:100%;min-height:calc(100vh - 75px);margin:0 auto;padding:15px;}
  .infix-page .main-card{padding:22px;border-radius:18px;}
  .infix-page h2{font-size:22px;}
  .infix-page .btn-group{gap:10px;}
  .infix-page .btn-convert,.infix-page .btn-clear{max-width:100%;padding:11px 18px;}
  .infix-page .back-btn{padding:10px 18px;}
}
body.infix-page { min-height: 100vh; height: auto; overflow-x: hidden; overflow-y: auto; }
.infix-page .container { position: relative; z-index: 1; width: 100%; max-width: 1250px; margin: 35px auto; padding: 0 24px; box-sizing: border-box; min-height: auto; display: block; }
.infix-page .two-window-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 28px; width: 100%; }
.infix-page .two-window-layout .main-card { width: 100%; min-width: 0; max-width: none; margin: 0; padding: 28px; box-sizing: border-box; border-radius: 20px; background: rgba(255, 255, 255, 0.90); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.30); color: #660000; }
.infix-page .two-window-layout h2 { margin: 0 0 12px; padding-bottom: 10px; text-align: center; color: #990000; border-bottom: 3px solid #cc3333; font-size: 25px; }
.infix-page .two-window-layout .subtitle { margin: 12px 0 25px; text-align: center; font-style: italic; line-height: 1.5; }
.infix-page .two-window-layout label { display: block; margin: 18px 0 8px; font-weight: bold; }
.infix-page .two-window-layout input[type="text"] { display: block; width: 100%; min-height: 46px; padding: 12px; margin-bottom: 18px; box-sizing: border-box; border: 2px solid #cc3333; border-radius: 10px; background: #fff; font-family: "Times New Roman", Times, serif; font-size: 16px; }
.infix-page .two-window-layout input[type="text"]:focus { outline: 2px solid rgba(153, 0, 0, 0.20); border-color: #990000; }
.infix-page .two-window-layout .btn-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0; }
.infix-page .two-window-layout .btn-group button { min-height: 42px; padding: 11px 18px; border: none; border-radius: 10px; color: #fff; font-family: "Times New Roman", Times, serif; font-size: 15px; font-weight: bold; cursor: pointer; transition: background 0.2s, transform 0.2s; }
.infix-page .two-window-layout .btn-convert { background: #cc3333; }
.infix-page .two-window-layout .btn-convert:hover { background: #990000; transform: translateY(-2px); }
.infix-page .two-window-layout .btn-clear { background: #990000; }
.infix-page .two-window-layout .btn-clear:hover { background: #700000; transform: translateY(-2px); }
.infix-page .two-window-layout hr { display: none; }
.infix-page .two-window-layout .output-box { width: 100%; margin: 18px 0; padding: 14px 16px; box-sizing: border-box; border: 1px solid #cc3333; border-radius: 10px; background: rgba(204, 51, 51, 0.12); color: #660000; overflow-wrap: anywhere; }
.infix-page .two-window-layout .output-box p { margin: 4px 0; }
.infix-page .two-window-layout h3 { margin: 22px 0 12px; text-align: center; color: #800000; }
.infix-page .back-btn { display: block; width: fit-content; max-width: 100%; margin: 26px auto 0; padding: 12px 22px; box-sizing: border-box; border: 2px solid #990000; border-radius: 10px; color: #990000; text-align: center; text-decoration: none; font-weight: bold; }
.infix-page .back-btn:hover { background: #990000; color: #fff; }
@media (max-width: 800px) { .infix-page .container { margin: 20px auto; padding: 0 14px; } .infix-page .two-window-layout { grid-template-columns: 1fr; gap: 22px; } .infix-page .two-window-layout .main-card { padding: 24px 20px; } }

/* Queue and De-queue Style */
.queue-deque-container { position: relative; z-index: 2; max-width: 1100px !important; width: 90% !important; margin: 20px auto !important; padding: 25px 30px !important; background: rgba(255,255,255,0.90); border-radius: 20px; box-sizing: border-box; }
.queue-deque-card { background: transparent !important; box-shadow: none !important; border: none !important; padding: 0 !important; margin: 0 !important; width: 100%; box-sizing: border-box; }
.queue-deque-title { text-align: center; color: #990000; font-size: 28px; margin: 0 0 15px; padding-bottom: 10px; border-bottom: 2px solid #cc3333; background: transparent; }
.queue-deque-subtitle { text-align: center; margin: 0 0 25px; font-size: 15px; color: #773333; font-style: italic; background: transparent; }
.queue-deque-grid { display: grid !important; grid-template-columns: repeat(2,1fr) !important; gap: 25px !important; width: 100% !important; align-items: stretch !important; }
.queue-panel, .deque-panel { padding: 28px !important; border-radius: 20px; background: rgba(255,255,255,0.92); box-sizing: border-box; width: 100% !important; min-width: 0; color: #700000; height: auto !important; }
.queue-panel h3, .deque-panel h3 { margin: 0 0 16px; padding-bottom: 10px; text-align: center; color: #990000; font-size: 22px; border-bottom: 2px solid #cc3333; }
.queue-description { text-align: center; font-size: 15px; color: #773333; margin: 0 0 15px; font-style: italic; }
.queue-count { display: block; text-align: right; margin-bottom: 10px; color: #800000; font-size: 13px; font-weight: bold; }
.queue-display { min-height: 100px; padding: 20px; margin: 15px 0 20px; display: flex; align-items: center; justify-content: flex-start; gap: 16px; border-radius: 12px; border: 1px solid #cc3333; background: rgba(255,255,255,0.75); box-sizing: border-box; width: 100%; overflow-x: auto; }
.end-marker { background: #990000; color: #ffffff; padding: 10px 16px; border-radius: 8px; font-weight: bold; font-size: 15px; white-space: nowrap; flex-shrink: 0; }
.front-marker { }
.rear-marker { }
.queue-empty { text-align: center; font-style: italic; color: #997777; padding: 10px 5px; flex: 1; /* Pupuno sa gitna */ }
.queue-arrow { display: none; }
.queue-node-wrapper { display: inline-flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; }
.queue-node { min-width: 55px; min-height: 55px; padding: 10px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px solid #cc3333; border-radius: 8px; background: rgba(255,255,255,0.95); color: #800000; font-size: 15px; font-weight: bold; overflow-wrap: anywhere; box-sizing: border-box; flex-shrink: 0; }
.queue-end-label { display: block; color: #990000; font-size: 10px; font-weight: bold; }
.queue-rear-node { background: #f9dddd; }
.queue-form { width: 100%; box-sizing: border-box; }
.queue-form label { display: block; margin: 16px 0 8px; font-weight: bold; color: #700000; font-size: 15px; }
.queue-form input { display: block; width: 100%; box-sizing: border-box; padding: 13px 14px; border: 1px solid #cc3333; border-radius: 10px; background: rgba(255,255,255,0.98); color: #333; font-family: inherit; font-size: 15px; outline: none; }
.queue-form input:focus { border: 2px solid #b52b2b; }
.queue-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.queue-buttons button { flex: 1 1 100px; min-height: 42px; padding: 10px 14px; border: none; border-radius: 10px; background: #cc3333; color: #fff; font-family: inherit; font-size: 14px; font-weight: bold; cursor: pointer; transition: background 0.2s ease, transform 0.2s ease; }
.queue-buttons button:hover { background: #990000; transform: translateY(-2px); }
.queue-buttons .remove-button { background: #990000; color: #fff; border: 1px solid #990000; }
.queue-buttons .remove-button:hover { background: #700000; }
.queue-buttons .clear-button { flex-basis: 100%; background: #650000; color: #fff; }
.queue-buttons .clear-button:hover { background: #450000; }
.rear-buttons-only { margin-top: 10px; }
.queue-message { padding: 12px 15px; margin: 15px 0 20px; text-align: center; border-radius: 10px; font-weight: bold; }
.queue-message.success { background: #e3f5e5; color: #176b2c; border: 1px solid #9ed4a6; }
.queue-message.error { background: #ffe3e3; color: #990000; border: 1px solid #e9a1a1; }
.queue-back { display: block; width: fit-content; margin: 28px auto 0; padding: 12px 22px; color: #990000; background: rgba(255,255,255,0.75); border: 1px solid #990000; border-radius: 10px; text-decoration: none; font-weight: bold; text-align: center; transition: background 0.2s ease, color 0.2s ease; }
.queue-back:hover { background: #990000; color: #fff; }
body.works-page .queue-deque-container { max-width: 1100px !important; width: 90% !important; margin: 20px auto !important; padding: 25px 30px !important; }
body.works-page .queue-deque-grid { grid-template-columns: repeat(2,1fr) !important; align-items: stretch !important; gap: 25px !important; }
body.works-page .queue-panel,
body.works-page .deque-panel { padding: 28px !important; height: auto !important; }
@media (max-width: 850px) {
.queue-deque-container,
body.works-page .queue-deque-container { width: 94% !important; padding: 20px !important; }
.queue-deque-grid,
body.works-page .queue-deque-grid { grid-template-columns: 1fr !important; gap: 20px !important; }  }

/* Sorting Style */

body.sorting-page { margin: 0; min-height: 100vh; background: url("/static/images/black.jpg") no-repeat center center fixed; background-size: cover; font-family: 'Times New Roman', Times, serif; color: #900000; }
.sorting-page * { box-sizing: border-box; font-family: 'Times New Roman', Times, serif; }
.sorting-navbar { display: flex; justify-content: flex-end; align-items: center; padding: 15px 35px; gap: 20px; }
.sorting-logo { display: none; }
.sorting-navbar nav { display: flex; align-items: center; gap: 35px; flex-wrap: wrap; }
.sorting-navbar nav a { color: white; font-family: 'Times New Roman', Times, serif; font-size: 18px; font-weight: bold; text-decoration: none; text-shadow: 1px 1px 3px #700000; }
.sorting-navbar nav a:hover { color: #ffdddd; }
.sorting-container { width: 90%; max-width: 1200px; margin: 20px auto 60px; padding: 35px; background: rgba(255, 245, 247, 0.89); border-radius: 24px; box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25); }
.sorting-title { text-align: center; margin-bottom: 35px; padding-bottom: 22px; border-bottom: 2px solid #c60000; }
.sorting-title h1 { margin: 0 0 12px; font-size: 34px; color: #a00000; }
.sorting-title p { margin: 0; color: #945050; font-style: italic; line-height: 1.6; }
.sorting-section { background: rgba(255, 255, 255, 0.94); padding: 28px; margin-bottom: 25px; border-radius: 18px; border: 1px solid #f1caca; }
.sorting-section-title { display: flex; align-items: center; gap: 14px; margin-bottom: 25px; padding-bottom: 14px; border-bottom: 1px solid #e7b4b4; }
.sorting-number { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #a50000; color: white; border-radius: 12px; font-size: 16px; font-weight: bold; }
.sorting-section-title h2 { margin: 0; font-size: 23px; color: #990000; }
.sorting-array-form, .sorting-algorithm-form { display: flex; align-items: end; gap: 20px; flex-wrap: wrap; }
.sorting-field { flex: 1; min-width: 230px; }
.sorting-field label { display: block; margin-bottom: 10px; color: #8b0000; font-weight: bold; }
.sorting-field input, .sorting-field select { width: 100%; padding: 14px 16px; background: #fff; border: 1px solid #d34c4c; border-radius: 10px; color: #6e0000; font-size: 15px; font-family: 'Times New Roman', Times, serif; outline: none; }
.sorting-field input:focus, .sorting-field select:focus { border-color: #b00000; box-shadow: 0 0 0 3px rgba(180, 0, 0, 0.1); }
.sorting-field small { display: block; margin-top: 9px; color: #9b6b6b; }
.sorting-form-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.sorting-btn { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 12px 20px; border: 1px solid transparent; border-radius: 10px; font-family: 'Times New Roman', Times, serif; font-size: 14px; font-weight: bold; text-decoration: none; cursor: pointer; transition: 0.2s ease; }
.sorting-btn.red { background: #d02f32; color: white; }
.sorting-btn.dark-red { background: #a00000; color: white; }
.sorting-btn.outline { background: white; color: #990000; border-color: #c90000; }
.sorting-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(0.9); }
.sorting-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.sorting-visual-section { min-height: 420px; }
.sorting-visual-header { display: flex; justify-content: space-between; gap: 15px; flex-wrap: wrap; padding: 15px 20px; background: #fce7e7; border: 1px solid #efc0c0; border-radius: 12px; color: #990000; font-size: 14px; font-weight: bold; }
.sorting-array-display { display: flex; justify-content: center; align-items: center; align-content: center; flex-wrap: wrap; gap: 15px; min-height: 190px; padding: 35px 15px; }
.sorting-element { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sorting-element-index { color: #a66a6a; font-size: 12px; }
.sorting-element-value { display: flex; justify-content: center; align-items: center; min-width: 60px; min-height: 60px; padding: 10px; background: #fff5f5; color: #970000; border: 2px solid #c93434; border-radius: 12px; font-size: 20px; font-weight: bold; box-shadow: 0 3px 8px rgba(150, 0, 0, 0.08); }
.sorting-element.is-active .sorting-element-value { background: #d02f32; color: white; border-color: #8f0000; transform: translateY(-7px); }
.sorting-element.is-sorted .sorting-element-value { background: #a00000; color: white; border-color: #710000; }
.sorting-empty { color: #a66a6a; font-style: italic; }
.sorting-message { padding: 18px 22px; background: #fce5e5; border-left: 5px solid #b00000; border-radius: 0 12px 12px 0; }
.sorting-message-label { display: block; color: #9b0000; font-size: 11px; font-weight: bold; letter-spacing: 1px; }
.sorting-message p { margin: 9px 0 0; color: #8c4545; font-size: 14px; line-height: 1.6; }
.sorting-step-controls { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 25px; }
.sorting-step-counter { padding: 12px 18px; background: #fff0f0; border: 1px solid #efc5c5; border-radius: 10px; color: #990000; font-weight: bold; font-size: 14px; }
.sorting-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.sorting-stat-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 12px; background: #fff0f0; border: 1px solid #e9b6b6; border-radius: 14px; text-align: center; }
.sorting-stat-card span { color: #9a5555; font-size: 13px; }
.sorting-stat-card strong { color: #a00000; font-size: 25px; }
.sorting-footer { display: flex; justify-content: center; padding-top: 5px; }
@media (max-width: 800px) { .sorting-navbar { flex-direction: column; text-align: center; } .sorting-container { width: 95%; padding: 20px; } .sorting-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .sorting-navbar { justify-content: center; padding: 15px; } .sorting-navbar nav { justify-content: center; gap: 20px; } .sorting-navbar nav a { font-size: 16px; } }
@media (max-width: 500px) { .sorting-title h1 { font-size: 26px; } .sorting-section { padding: 18px; } .sorting-section-title h2 { font-size: 18px; } .sorting-form-buttons { width: 100%; } .sorting-form-buttons .sorting-btn { flex: 1; } .sorting-stats { grid-template-columns: 1fr 1fr; gap: 10px; } .sorting-stat-card { padding: 18px 8px; } .sorting-step-controls { gap: 8px; } }

/* Binary Tree Style */

.binarytree-page * { box-sizing: border-box; font-family: 'Times New Roman', Times, serif; }
.binarytree-navbar { display: flex; justify-content: flex-end; align-items: center; gap: 35px; padding: 15px 35px; }
.binarytree-navbar a { color: white; font-size: 19px; font-weight: bold; text-decoration: none; text-shadow: 1px 1px 3px #700000; }
.binarytree-navbar a:hover { color: #ffdddd; }
.binarytree-container { width: 92%; max-width: 1350px; margin: 20px auto 60px; padding: 32px; background: rgba(255, 245, 247, 0.9); border-radius: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.binarytree-heading { text-align: center; padding-bottom: 22px; margin-bottom: 25px; border-bottom: 2px solid #c60000; }
.binarytree-heading h1 { color: #990000; font-size: 34px; margin: 0 0 10px; }
.binarytree-heading p { color: #945050; font-size: 16px; font-style: italic; margin: 0; }
.binarytree-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 25px; }
.binarytree-summary-card { display: flex; flex-direction: column; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.96); border: 1px solid #f1caca; border-radius: 14px; padding: 18px; }
.binarytree-summary-card span { color: #965555; font-size: 15px; }
.binarytree-summary-card strong { color: #a00000; font-size: 27px; }
.binarytree-workspace { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 22px; align-items: start; }
.binarytree-controls { display: flex; flex-direction: column; gap: 18px; }
.binarytree-panel { background: rgba(255, 255, 255, 0.96); border: 1px solid #f1caca; border-radius: 16px; padding: 22px; }
.binarytree-panel h2 { color: #990000; font-size: 22px; margin: 0 0 10px; padding-bottom: 12px; border-bottom: 1px solid #e7b4b4; }
.binarytree-panel p { color: #965555; font-size: 14px; line-height: 1.5; margin: 0 0 16px; }
.binarytree-panel label { display: block; color: #850000; font-size: 15px; font-weight: bold; margin-bottom: 8px; }
.binarytree-panel input { display: block; width: 100%; padding: 12px; border: 1px solid #d34c4c; border-radius: 9px; background: white; color: #700000; font-size: 15px; margin-bottom: 12px; outline: none; }
.binarytree-panel input:focus { border-color: #990000; box-shadow: 0 0 0 3px rgba(153, 0, 0, 0.1); }
.binarytree-btn { width: 100%; min-height: 43px; border: none; border-radius: 9px; color: white; font-size: 15px; font-weight: bold; cursor: pointer; transition: 0.2s ease; }
.binarytree-btn.red { background: #d02f32; }
.binarytree-btn.dark-red { background: #a00000; }
.binarytree-btn.clear { background: #680000; }
.binarytree-btn:hover { filter: brightness(0.88); transform: translateY(-2px); }
.binarytree-visual-panel { background: rgba(255, 255, 255, 0.96); border: 1px solid #f1caca; border-radius: 16px; padding: 24px; min-width: 0; }
.binarytree-visual-title { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-bottom: 16px; border-bottom: 1px solid #e7b4b4; }
.binarytree-visual-title h2 { color: #990000; font-size: 23px; margin: 0; }
.binarytree-visual-title span { background: #fff0f0; border: 1px solid #e9b6b6; border-radius: 8px; padding: 8px 12px; color: #990000; white-space: nowrap; }
.binarytree-notification { margin-top: 18px; padding: 14px 18px; border-radius: 10px; font-size: 15px; background: #fce7e7; color: #850000; border-left: 4px solid #b00000; }
.binarytree-notification.success { background: #fff0f0; border-left-color: #a00000; }
.binarytree-notification.error { background: #ffe2e2; border-left-color: #d02f32; }
.binarytree-canvas { display: flex; align-items: center; justify-content: flex-start; overflow-x: auto; min-height: 350px; margin: 20px 0; padding: 15px; background-color: #fffafa; background-image: radial-gradient(#eccaca 1px, transparent 1px); background-size: 20px 20px; border: 1px solid #f0d0d0; border-radius: 14px; }
.binarytree-canvas svg { display: block; flex-shrink: 0; margin: auto; }
.binarytree-empty { width: 100%; text-align: center; padding: 40px 15px; }
.binarytree-empty h3 { color: #990000; font-size: 23px; }
.binarytree-empty p { color: #a66a6a; font-size: 15px; font-style: italic; }
.binarytree-traversal { background: #fff0f0; border: 1px solid #efc5c5; border-radius: 12px; padding: 18px; margin-top: 15px; }
.binarytree-traversal h3 { color: #990000; font-size: 19px; margin: 0 0 7px; }
.binarytree-traversal p { color: #a66a6a; font-size: 14px; font-style: italic; margin: 0 0 12px; }
.binarytree-result { color: #850000; font-size: 18px; font-weight: bold; line-height: 1.6; overflow-wrap: anywhere; }
.binarytree-footer { display: flex; justify-content: center; margin-top: 30px; }
.binarytree-back { display: inline-block; padding: 12px 28px; border: 2px solid #b00000; border-radius: 9px; color: #990000; background: white; text-decoration: none; font-size: 16px; font-weight: bold; }
.binarytree-back:hover { background: #b00000; color: white; }
@media (max-width: 950px) { .binarytree-workspace { grid-template-columns: 1fr; } .binarytree-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .binarytree-navbar { justify-content: center; gap: 20px; padding: 15px; flex-wrap: wrap; } .binarytree-navbar a { font-size: 17px; } .binarytree-container { width: 95%; padding: 18px; } .binarytree-heading h1 { font-size: 27px; } .binarytree-summary { gap: 8px; } .binarytree-summary-card { padding: 12px 5px; } .binarytree-summary-card span { font-size: 12px; } .binarytree-summary-card strong { font-size: 21px; } .binarytree-controls { grid-template-columns: 1fr; } .binarytree-visual-panel { padding: 15px; } .binarytree-visual-title h2 { font-size: 19px; } }
