@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');
body {
  margin: 0;
  padding: 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  height: 100vh;
  background-color: var(--body-color);
}
/* ===== Google Font Import - Poppins ===== */
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    transition: all 0.4s ease;;
}
/* ===== Colours ===== */
:root{
    --body-color: #E4E9F7;
    --nav-color: #4070F4;
    --side-nav: #010718;
    --text-color: #FFF;
    --search-bar: #F2F2F2;
    --search-text: #010718;
}

body.dark{
    --body-color: #18191A;
    --nav-color: #242526;
    --side-nav: #242526;
    --text-color: #CCC;
    --search-bar: #242526;
}
nav{
    position: fixed;
    top: 0;
    left: 0;
    height: 70px;
    width: 100%;
    background-color: var(--nav-color);
    z-index: 100;
}
body.dark nav{
    border: 1px solid #393838;
}
nav .nav-bar{
    position: relative;
    height: 100%;
    max-width: 1000px;
    width: 100%;
    background-color: var(--nav-color);
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    font-family: "Audiowide", sans-serif;
}
nav .nav-bar .sidebarOpen{
    color: var(--text-color);
    font-size: 25px;
    padding: 5px;
    cursor: pointer;
    display: none;
}
nav .nav-bar .logo a{
    font-size: 25px;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
}
.menu .logo-toggle{
    display: none;
}
.nav-bar .nav-links{
    display: flex;
    align-items: center;
}
.nav-bar .nav-links li{
    margin: 0 5px;
    list-style: none;
}
.nav-links li a{
    position: relative;
    font-size: 17px;
    font-weight: 400;
    color: var(--text-color);
    text-decoration: none;
    padding: 10px;
}
.nav-links li a::before{
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    height: 6px;
    width: 6px;
    border-radius: 50%;
    background-color: var(--text-color);
    opacity: 0;
    transition: all 0.3s ease;
}
.nav-links li:hover a::before{
    opacity: 1;
}
.nav-bar .darkLight-searchBox{
    display: flex;
    align-items: center;
}
.darkLight-searchBox .dark-light,
.darkLight-searchBox .searchToggle{
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
}
.dark-light i,
.searchToggle i{
    position: absolute;
    color: var(--text-color);
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.dark-light i.sun{
    opacity: 0;
    pointer-events: none;
}
.dark-light.active i.sun{
    opacity: 1;
    pointer-events: auto;
}
.dark-light.active i.moon{
    opacity: 0;
    pointer-events: none;
}
.searchToggle i.cancel{
    opacity: 0;
    pointer-events: none;
}
.searchToggle.active i.cancel{
    opacity: 1;
    pointer-events: auto;
}
.searchToggle.active i.search{
    opacity: 0;
    pointer-events: none;
}
.searchBox{
    position: relative;
}
.searchBox .search-field{
    position: absolute;
    bottom: -85px;
    right: 5px;
    height: 50px;
    width: 300px;
    display: flex;
    align-items: center;
    background-color: var(--nav-color);
    padding: 3px;
    border-radius: 6px;
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}
.searchToggle.active ~ .search-field{
    bottom: -74px;
    opacity: 1;
    pointer-events: auto;
}
.search-field::before{
    content: '';
    position: absolute;
    right: 14px;
    top: -4px;
    height: 12px;
    width: 12px;
    background-color: var(--nav-color);
    transform: rotate(-45deg);
    z-index: -1;
}
.search-field input{
    height: 100%;
    width: 100%;
    padding: 0 45px 0 15px;
    outline: none;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    color: var(--search-text);
    background-color: var(--search-bar);
}
body.dark .search-field input{
    color: var(--text-color);
}
.search-field i{
    position: absolute;
    color: var(--nav-color);
    right: 15px;
    font-size: 22px;
    cursor: pointer;
}
body.dark .search-field i{
    color: var(--text-color);
}
@media (max-width: 790px) {
    nav .nav-bar .sidebarOpen{
        display: block;
    }
    .menu{
        position: fixed;
        height: 100%;
        width: 320px;
        left: -100%;
        top: 0;
        padding: 20px;
        background-color: var(--side-nav);
        z-index: 100;
        transition: all 0.4s ease;
    }
    nav.active .menu{
        left: -0%;
    }
    nav.active .nav-bar .navLogo a{
        opacity: 0;
        transition: all 0.3s ease;
    }
    .menu .logo-toggle{
        display: block;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .logo-toggle .siderbarClose{
        color: var(--text-color);
        font-size: 24px;
        cursor: pointer;
    }
    .nav-bar .nav-links{
        flex-direction: column;
        padding-top: 30px;
    }
    .nav-links li a{
        display: block;
        margin-top: 20px;
    }
}
/*                       Top header search part ended*/
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.folder {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 20px 15px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.folder:hover {
  transform: scale(1.05);
  background: #f0f8ff;
}

.folder-icon {
  font-size: 50px;
  color: #e53935;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.essay-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 5px;
  color: #023047;
}

.author {
  font-size: 13px;
  color: #666;
}

.tag {
  font-size: 12px;
  background-color: #0078d7;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 6px;
}
.score {
    font-size: 12px;
    background-color: #0078d7;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 6px;
  }
  .type {
    font-size: 12px;
    background-color: #0078d7;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 6px;
  }

.more-button {
  display: block;
  margin: 30px auto 0;
  margin-bottom: 30px;
  padding: 10px 30px;
  font-size: 16px;
  background-color: #0078d7;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.more-button:hover {
  background-color: #005ea1;
}

@media screen and (max-width: 480px) {
  body {
    padding: 14px;
  }

  .top-left-link {
    position: absolute;
    top: 13px;
    left: 10px;
    padding: 26px 10px;
    color: #ccc5b9;
    text-decoration: none;
    font-size: 5%;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
  }

  .folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }
  .folder {
    padding: 15px 10px;
  }
  .folder-icon {
    font-size: 40px;
  }
  .chat-messages h1 {
  font-size: 1.2rem;
  font-weight: bold;
  }
  .chat-messages h3 {
  font-size: 0.8rem;
  font-weight: bold;
  }
}
/*live topic*/
.live-topic-box {
  background: #f0f8ff;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  font-family: 'Segoe UI', sans-serif;
  color: #0077cc;
  margin: 40px auto;
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
/*to keep centered*/
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center; 
}

.live-topic-box::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-image: url(map-bg.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  filter: blur(10px);
  z-index: 1;
}
/*news*/
.live-topic-box h2 {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 4px;
  font-size: 2rem;
  font-weight: bold;
  z-index: 2;
}

.live-topic-box h3 {
  font-size: 1.7rem;
  color: #020fc6;
  font-weight: 300;
  position: relative;
  z-index: 2;
}

#liveTopic::after {
  content: "|";
  animation: blink 0.9s infinite;
  position: absolute;
  margin-left: 2px;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

footer ul {
  display: flex;
  grid-auto-flow: row;
  grid-gap: 24px;
  justify-items: center;
  margin: auto;
}

@media (max-width: 500px) {
  footer ul {
    font-size: 12px;
  }
}

footer a {
  color: #929292;
  box-shadow: inset 0 -1px 0 hsla(0, 0%, 100%, 0.4);
  text-decoration: none;
}

footer a:hover {
  color: #666;
}

footer {
  display: flex;
  height: 20vh;
  width: 100%;
  line-height: 1.2;
  font-family: Menlo, monospace;
}

/*-----------------------------*/
.modal {
  display: none;
  position: fixed;
  z-index: 200;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.7);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: #ffffff;
  margin: 0;
  padding: 25px 30px;
  border-radius: 12px;
  max-width: 100%;
  width: 1800px;
  max-height: 97%;
  overflow-y: auto;
  position: relative;
  animation: slideIn 0.3s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.modal-content h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: #023047;
  font-weight: bold;
}

.modal-content h2, 
.modal-content h3, 
.modal-content h4 {
  margin: 4px 0;
  padding: 6px;
  color: #007700;
  font-weight: bold;
}

.modal-content p, 
.modal-content div {
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  font-family: "Poppins", serif;
}

.modal-content p {
    font-size: 18px;
    padding: 4px;
}

.close {
  position: absolute;
  top: 12px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #006400;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close:hover {
  color: #004d00;
}

.printBtn {
  background-color: #006400;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 12px;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.printBtn:hover {
  background-color: #004d00;
}

/* Scrollbar for long essays */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-thumb {
  background-color: #007700;
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-track {
  background: #e0e0e0;
}

/* Animations */
@keyframes fadeIn {
  from {opacity: 0;} 
  to {opacity: 1;}
}

@keyframes slideIn {
  from {transform: translateY(-50px); opacity: 0;}
  to {transform: translateY(0); opacity: 1;}
}

/* Responsive for small screens */
@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    padding: 20px;
  }

  .modal-content h1 {
    font-size: 1.5rem;
  }

  .modal-content p, .modal-content div {
    font-size: 13px;
  }

  .printBtn {
    width: 100%;
    padding: 12px 0;
  }
}

@media print {
  body {
    margin: 20px;
    padding: 0;
    background: white;
    color: black;
    font-family: 'Poppins', sans-serif;
  }

  p, div {
    margin: 1em 0;
    line-height: 1.6;
    font-size: 12pt;
    word-break: break-word;
    padding: 10px;
  }

  h1, h2, h3, h4 {
    margin: 0;
    page-break-after: avoid;
  }

  h1, h2 {
    font-size: 1.8rem;
  }

  .printBtn, .close {
    display: none; /* hide modal buttons in print */
  }

  .modal-content {
    max-width: 100%;
    width: 100%;
    overflow: visible;
  }
}

.warning {
  text-align: center;
  font-size: 18px;
  color: var(--text-color);
  font-family: "Audiowide", sans-serif;
}