.quest-modal {
    flex:1;
    position: absolute;
    top: 220px;
    left: 500px;
    width: 800px;
    height:500px;
    background: #a06041;
    border: 3px solid #534a40;
    display: none;
    overflow-y:auto;
}

.quest-modal .yellow{
    height:510px;
    width:810px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; 
}
.quest-modal .white{
    height:480px;
    width:785px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; 
}

/* Main Learning Panel */
.learning-panel {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #ffb94f transparent; /* thumb color + transparent track */
    position: absolute;
    top: 150px;
    left: 335px;
    width: 1150px;
    height: 680px;
    background-color: #a06041;
    border: 2px solid #555;
    padding: 0; /* ← CHANGED: removed padding */
    display: flex;
    flex-direction: column;
    gap: 0;
    display: none;
    z-index: 0;
    overflow-y: auto;
}



.learning-panel .yellow {
    position: absolute;
    top: 15px;
    left: 13px;
    width: 1120px;
    height: 650px;
    background-color: #e2b740;
}

.learning-panel .white {
    display: flex;
    flex-direction:column;
    align-items:center;
    position: absolute;
    top:15px;
    left: 13px;
    width: 1095px;
    height: 625px;
    background-color: #fff9ea;
    gap:20px;
    
}

/* Fixed Header Section */
.learning-panel-header {
    flex: 0.3;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 10px 10px 0 0;
    width:1000px;
    height: 680px;
}

.learning-panel-bottom {
    flex: 0 0 auto;
    width: 955px;
    height: 100px;
    margin-top:1px;
    padding: 8px; /* Reduced from 10px */
    padding-top: 2px;
    padding-bottom: 0px;
    border-top: 2px solid #a06041;
    gap: 0;
}

    .learning-panel-bottom p {
        font-family: 'Press Start 2P', monospace;
        color: #ffb94f;
        font-weight:5;
        font-size:20px;
    }

.learning-panel h3 {
    flex:0.1;
    margin: 40px 0 30px 0;
    text-align: center;
    font-family: 'Press Start 2P', monospace;
    color: #754833;
    font-weight:5;
    font-size:46px;
    
}

.learning-panel-content-container {
    flex:0.68;
    margin: 5px;
    width: 700px;
    height:auto;
    padding-bottom:0px;
    margin-bottom:5px;
}

.learning-panel-content hr {
    border-color: #ffb94f;
    resize: 2px;
}

.learning-panel-content {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #ffb94f transparent; /* thumb color + transparent track */
    border-radius: 25px;
    margin-top: 5px;
    margin-bottom: 0px;
    flex: 0 0 auto;
    width: 600px;
    margin-left:50px;
    height:auto;
    max-height:290px;
    background-color: #a06041;
    overflow: auto;
    border: 2px solid #6e3f29;
    align-self:center;
}



.learning-panel-content h4{
    flex:1;
}

/* Content Tabs */
.content-tabs {
    flex: 0.3;
    display: flex;
    gap:25px;
    margin-top:10px;
    margin-bottom:0;
    padding: 5px;
    width: 800px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.tab-btn {
    line-height:1.8;
    flex: 0 1 220px;
    color: #ffb94f;
    background: #a06041;
    border: 3px solid #534a40;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 2px 2px 4px rgba(5, 5, 1, 1);
    box-shadow: inset 4px 3px 5px #ffbf5e, 2px 2px 0 #000, /* extra “pixel” edges */
    4px 4px 0 #000;
    padding: 4px 10px;
}

.tab-btn.active {
    background: white;
    box-shadow: inset 4px 3px 5px gray, 2px 2px 0 #000, /* extra �pixel� edges */
    4px 4px 0 #000;

}

.tab-btn:hover:not(.active) {
    background: white;
        box-shadow: inset 4px 3px 5px gray, 2px 2px 0 #000, /* extra �pixel� edges */
        4px 4px 0 #000;

}

/* Search Section */
#search-generate {
    border-top: solid 1px #ffb94f;
    border-bottom: solid 1px #ffb94f;
    border-left: none;
    border-right: none;
    flex: 0.1;
    display: flex;
    gap: 10px;
    width: 1000px;
    max-width: 750px;
}

#topic-search {
    border-left: none;
    border-right: none;
    border-top:none;
    border-bottom:none;
    width: 1000px;
    padding: 8px;
    background-color: #fff9ea;
}

/* Search Results */
#search-results h4 {
    margin: 5px 0 15px 0;
    text-align: center;
}

.result-btn, .category-btn {
    display: block;
    width: 1000px;
    margin: 5px 0;
    padding: 10px;
    background: #34495e;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    text-align: left;
}

.result-btn:hover, .category-btn:hover {
    background: #3498db;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 0;
    height: 40px; /* Pagination takes 80% of bottom panel */
}


.pagination button {
    padding: 8px 15px;
    background: #3498db;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
}

.pagination button:hover:not(:disabled) {
    background: #2980b9;
}

.pagination button[style*="hidden"] {
    cursor: default;
}

/* AI Suggestion - Fixed at Bottom */
#ai-suggestion {
    text-align: center;
    border-radius: 5px;
    height: 80px; /* AI suggestion takes 30% of bottom panel */
    align-items: center; /* Vertical center */
    justify-content: center; /* Horizontal center */
    margin:0;
    padding: 0;
}

#bottom-pagination {
    margin-top:1%;
    color:black;
}

#generate-similar {
    flex: 1 1 250px;
    color: #ffb94f;
    background: #a06041;
    border: 3px solid #534a40;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 2px 2px 4px rgba(5, 5, 1, 1);
    box-shadow: inset 4px 3px 5px #ffbf5e, 2px 2px 0 #000, /* extra “pixel” edges */
    4px 4px 0 #000;
    padding: 5px 5px;
    vertical-align: middle;
    flex: 0 0 auto;
    line-height:1.8;
}

#generate-similar:hover {
    background: white;
        box-shadow: inset 4px 3px 5px gray, 2px 2px 0 #000, /* extra �pixel� edges */
        4px 4px 0 #000;

}

#generate-btn {
    white-space: nowrap;
}

#results-container {
    overflow-y: auto;
    max-height: 160px; /* Fixed height for results only */
    padding: 10px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}


.result-text {
    flex-grow: 1;
    cursor: pointer;
    padding: 5px;
}

    .result-text:hover {
        background-color: #fff9ea;
        border-radius: 5px;
        color:black;
    }

.delete-btn {
    background-color: #fff9ea;
    color: #754833;
    font-size:0.5rem;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

.delete-btn:hover {
    background-color:rgb(255, 35, 33);
}

.pagination span {
    text-align: center;
    color: #754833;
}

/* =========================
   Gemini API Key Section
   ========================= */
#api-key-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 14px 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

#api-key-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.9rem;
  transition: border-color 0.2s, background-color 0.2s;
}

#api-key-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

#api-key-input:focus {
  outline: none;
  border-color: #00b4ff;
  background-color: rgba(255, 255, 255, 0.15);
}

#save-api-key button{
  width:100px !important;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background-color: #00b4ff;
  color: red !important; 
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

#save-api-key:hover {
  background-color: #009ee0;
}

#save-api-key-modal{
    width:120px !important;
}

#save-api-key:active {
  transform: scale(0.97);
}

/* =========================
   AI Options Modal
   ========================= */
#ai-options-modal {
  position: fixed;
  top: -50px;
  left: -130px;
  width: 2200px;
  height: 1200px;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  pointer-events: auto;
}

.ai-options-content {
    top:80px;
    position: relative;
    width: 500px;
    height:650px;
    background: #a06041;
    border: 2px solid #555;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 5;
    pointer-events: auto;
}

.ai-options-content .yellow{
    left:10px;
    top:10px;
    width:530px;
    height:680px;
    border-radius:10px;
    display:flex;    
    flex-direction: column;
}

.ai-name-container{
    margin-top:50px;
    padding:0%;
    margin-bottom:10px;
}

.ai-name-container h2{
    margin:0;
    padding: 0%;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 2px 2px 2px rgba(5, 5, 1, 1);
    text-justify:center;
    font-size:30px;
    margin-bottom:15px;
}

.ai-options-content h2 {
    margin-top: 0;
    text-align: center;
    color: #faedd9;
}

.option-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top:15px;
  margin-bottom:15px;
  margin-left:25px;
}

.option-section label {
    text-align:left;
    letter-spacing:1.5px;
    font-size:17px;
  color:#754833;
}

.generate-ai-now-label{
    position:absolute;
    bottom:110px;
    left:160px;
    padding-top:25px;
    font-size:20px !important;
}

#generate-ai-now{
    position:absolute;
    bottom:30px;
    left:132px;
    margin-top:150px;
    position:absolute;
    width:270px;
    flex-basis:1;
    background: #a06041;
    color: #ffb94f;
    border: 3px solid #534a40;
    padding: 0px 5px;
    font-size: 12px;
    border-radius: 35px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 2px 2px 4px rgba(5, 5, 1, 1);
    padding: 20px 20px;
    box-shadow: inset 4px 3px 5px #ffbf5e, 2px 2px 0 #000, /* extra �pixel� edges */
    4px 4px 0 #000;
}

#generate-ai-now:hover{
    background: white;
    box-shadow: inset 4px 3px 5px gray, 2px 2px 0 #000, /* extra �pixel� edges */
    4px 4px 0 #000;
}
#api-key-input-modal {
    width: 460px;
    background-color: rgba(117, 72, 51, 0.5);
}

#api-key-input-modal::placeholder {
    color:white;
}
.option-section input[type="password"],
.option-section input[type="file"]
.option-section input[type="text"] {
  padding: 8px 10px;
  border: 1px solid #555;
  background: #754833;
  color: white;
  width:250px;
}

#gemini-topic{
    padding: 8px 10px;
  border: 1px solid #555;
  background-color: rgba(117, 72, 51, 0.5);
  color: white;
  appearance:none;
  width:460px;
}

input::placeholder {
    color: white;      /* pure white */
    opacity: 1;        /* removes the faded look */
  }


 #study-mode{
    background-color:#754833;
    width:482.5px;
    color:white;
    height:30px;
    border:red;
    padding-bottom:0px;
 } 

.option-section #file-input{

    width:120px;
    height:30px;
    padding-bottom:30px;
    border-radius:5px;
    background:none;
    border:none;
    margin:0px;
    padding-left:0px;
    margin-top:0;
    padding-top:0;
    overflow:hidden;
}

.option-section{

    margin-bottom:0px;
}

#file-input{
    width:30px;
}

#file-input::file-selector-button {
    margin-left:0;
    border:none;
    background-color: #754833;
    width: 130px;
    height: 30px;
    color: white;
    border-radius: 8px;
    padding: 10px; /* 👈 makes it bigger */
    padding-top:4px;
    padding-bottom:4px;
    cursor: pointer;
}

#file-input::file-selector-button:hover {
        background-color: #9e674d;
}

.option-section button {
    padding-left: 0px;
    margin: 0px;
    align-self: flex-start;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    background: #754833;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

    .option-section button:hover {
        background: #9e674d;
    }

.close-btn {
    width: 35px;
    height: 35px;
    top: 10px;
    position: absolute;
    right: 10px;
    border-radius: 100%;
    color: #ffb94f;
    background-color: #a06041;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 2px 2px 4px rgba(5, 5, 1, 1);
    padding: 0 0 0 0;
    border: 3px solid #534a40;
}

.close-btn:hover {
    background-color:white;
    right:0.2;
    top:0.2;
    width:37px;
    height:37px;
    transition:ease 0.2s;
}

.note {
    font-size: 0.8rem;
    color: #754833;
    margin: 0;
}

.quest-modal #close-quest {
    width: 35px;
    height: 35px;
    top: 7px;
    position: absolute;
    right: 10px;
    border-radius: 100%;
    color: #ffb94f;
    background-color: #a06041;
    font-family: 'Press Start 2P', monospace;
    text-shadow: 2px 2px 4px rgba(5, 5, 1, 1);
    padding: 0 0 0 0;
    border: 3px solid #534a40;
}

.quest-modal #close-quest:hover{
    background-color:white;
    top:5px;
    right:5px;
    width:37px;
    height:37px;
    transition:ease 0.2s;
    
}

.loading{
    width:1000px;
    color:#a06041 !important;
    position:absolute;
    font-size:20px;
    top:220px;
    left:-110px;
    font-family: 'Press Start 2P', monospace;
}

.success-generated{
    width:700px;
    color:#27ae60 !important;
    position:absolute;
    font-size:20px;
    top:210px;
    left:20px;
    font-family: 'Press Start 2P', monospace;
}

/* 
this slows down chrome android!!!
.blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 10000px;
    height: 10000px;
    backdrop-filter: blur(10px);
    z-index: 9998;
    pointer-events: none;
} */

