/* Import Google Font - Poppins */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
    font-family: "Cairo", sans-serif;
}
:root {
  /* Dark mode colors */
  --text-color: #e3e3e3;
  --subheading-color: #828282;
  --placeholder-color: #a6a6a6;
  --primary-color: #242424;
  --secondary-color: #383838;
  --secondary-hover-color: #444;
   --shadow-light1: #0005;
  --shadow-light2: #0004;
  --shadow-dark1: #fff2;
  --shadow-dark2: #fff1;
  
}
.light_mode {
  /* Light mode colors */
  --text-color: #222;
  --subheading-color: #a0a0a0;
  --placeholder-color: #6c6c6c;
  --primary-color: #fff;
  --secondary-color: #e9eef6;
  --secondary-hover-color: #dbe1ea;
   --shadow-light1: #fff9;
  --shadow-light2: #fff9;
  --shadow-dark1: #0002;
  --shadow-dark2: #0001;
}

body {
  background: var(--primary-color);
  width:100%;
  overflow-x: clip;
   font-family:  monospace !important;
    line-height: 1.75;
      
}

body.light_mode{
    background-image: url("https://raw.githubusercontent.com/mobalti/open-props-interfaces/refs/heads/main/ai-hero-chat-popover/assets/bg-gradient.jpg") !important;
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
        width:100%;
}
.note-container {
    background: var(--secondary-color);
    width:fit-content;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  }

  h1, h2, h3 { font-family: 'Inter', 'Cairo', sans-serif; font-weight: 700; color: var(--text-color); }
  h1 { font-size: 2.25rem; margin-bottom: 1.25rem; }
  h2 { font-size: 1.5rem; margin-top: 1.5rem; margin-bottom: 1rem; }
  h3 { font-size: 1.25rem; margin-top: 1.25rem; margin-bottom: 0.75rem; }
  p , li {  font-size: 1.05rem; }

  table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    background-color: var(--secondary-color);
    color: var(--text-color);
  }
  thead { background: linear-gradient(to right, #2563eb, #3b82f6); color: white; }
  th, td { padding: 0.9rem 1rem; text-align: center; color: var(--text-color);}
  th { font-weight: 600; letter-spacing: 0.5px; }
  tbody tr:nth-child(even) { background: var(--secondary-color); color: var(--text-color)}
  tbody tr:nth-child(odd) { background: var(--secondary-color); color: var(--text-color)}
  tbody tr:hover { background: var(--secondary-hover-color); transition: 0.3s ease-in-out; color: var(--text-color)}
  td { border-top: 1px solid #e5e7eb;color: var(--text-color) }
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 65px;
  background-color: var(--secondary-color);
  display: flex;
  justify-content: center;
  align-items: center;
  padding-left: auto;
  user-select: none;
  z-index: 999999999;
}
nav h1 {
  font-size: 25px !important;
  color: var(--text-color);
  font-family: sans-serif;
  margin-bottom: 0rem;
  font-weight: 700;
}
nav h1 span {
  width: fit-content;
    background-clip: text;
    background: linear-gradient(to right, #4285f4, #d96570);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header,
.chat-list .message,
.typing-form {
  margin: 0 auto;
  max-width: 980px;
}
.header {
  margin-top: 9vh;
  padding: 1rem;
  overflow-x: hidden;
}
body.hide-header .header {
  margin: 0;
  display: none;
}
.header :where(.title, .subtitle) {
  color: var(--text-color);
  font-weight: 500;
  line-height: 4rem;
}
.header .title {
  width: fit-content;
  font-size: 3rem;
  background-clip: text;
  background: linear-gradient(to right, #4285f4, #d96570);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header .subtitle {
  font-size: 2.6rem;
  color: var(--subheading-color);
}
.suggestion-list {
  width: 100%;
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin-top: 9.5vh;
  overflow: hidden;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.suggestion-list .suggestion {
  cursor: pointer;
  padding: 1.25rem;
  width: 222px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  border-radius: 0.75rem;
  justify-content: space-between;
  background: var(--secondary-color);
  transition: 0.2s ease;
}
.suggestion-list .suggestion:hover {
  background: var(--secondary-hover-color);
}
.suggestion-list .suggestion :where(.text, .icon) {
  font-weight: 400;
  color: var(--text-color);
}
.suggestion-list .suggestion .icon {
  width: 42px;
  height: 42px;
  display: flex;
  font-size: 1.3rem;
  margin-top: 2.5rem;
  align-self: flex-end;
  align-items: center;
  border-radius: 50%;
  justify-content: center;
  color: var(--text-color);
  background: var(--primary-color);
}
.chat-list {
  /* padding: 2rem 1rem 12rem; */
  min-height: 0vh;
  overflow-y: auto;
  scrollbar-color: #999 transparent;
  margin-top: 9vh;
  padding: 4px 20px ;
   direction: rtl;             /* الاتجاه الأساسي عربي */
  unicode-bidi: plaintext;    /* يخلي كل جزء ياخد اتجاه لغته */
  text-align: start;
}
.chat-list:not(:empty) {
  margin-bottom: 160px;

}
.chat-list .message.incoming {
  margin-top: 1.5rem;
}
.chat-list .message .message-content {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 20px;
    overflow-x: auto;
    overflow-y: clip;
    align-items: center;
}
.chat-list .message .text {
  color: var(--text-color);
  white-space: pre-wrap;
  /* padding-left: 50px; */
  /* margin-top: -20px; */
  width: fit-content;
  position: relative;
  font-family: "Cairo", sans-serif;}
.chat-list .message.error .text {
  color: #e55865;
}
.chat-list .message.loading .text {
  display: none;
}
.chat-list .message .avatar {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  align-self: flex-start;
}
.chat-list .message.loading .avatar {
  animation: rotate 3s linear infinite;
}
@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}
.chat-list .message .icon {
  color: var(--text-color);
  cursor: pointer;
  height: 35px;
  width: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  font-size: 1.25rem;
  margin-left: 3.5rem;
  visibility: hidden;
}
.chat-list .message .icon.hide {
  visibility: hidden;
}
.chat-list .message:not(.loading, .error):hover .icon:not(.hide) {
  visibility: visible;
}
.chat-list .message .icon:hover {
  background: var(--secondary-hover-color);
}
.chat-list .message .loading-indicator {
  display: none;
  gap: 0.8rem;
  width: 100%;
  flex-direction: column;
}
.chat-list .message.loading .loading-indicator {
  display: flex;
}
.chat-list .message .loading-indicator .loading-bar {
  height: 11px;
  width: 100%;
  border-radius: 0.135rem;
  background-position: -800px 0;
  background: linear-gradient(to right, #4285f4, var(--primary-color), #4285f4);
  animation: loading 3s linear infinite;
}
.chat-list .message .loading-indicator .loading-bar:last-child {
  width: 70%;
}
@keyframes loading {
  0% {
    background-position: -800px 0;
  }
  100% {
    background-position: 800px 0;
  }
}
.typing-area {
  position: fixed;
  width: 100%;
  left: 0;
  bottom: 0;
  padding: 1rem;
  background-color: var(--primary-color);
}
.typing-area :where(.typing-form, .action-buttons) {
  display: flex;
  gap: 0.75rem;
}
.typing-form .input-wrapper {
  width: 100%;
  height: 56px;
  display: flex;
  position: relative;
}
.typing-form .typing-input {
  height: 100%;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 1rem;
  color: var(--text-color);
  padding: 1.1rem 4rem 1.1rem 1.5rem;
  border-radius: 100px;
  background: var(--secondary-color);
}
.typing-form .typing-input:focus {
  background: var(--secondary-hover-color);
}
.typing-form .typing-input::placeholder {
  color: var(--placeholder-color);
}
.typing-area .icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  font-size: 1.4rem;
  color: var(--text-color);
  align-items: center;
  justify-content: center;
  background: var(--secondary-color);
  transition: 0.2s ease;
}
.typing-area .icon:hover {
  background: var(--secondary-hover-color);
}
.typing-form #send-message-button {
  position: absolute;
  right: 0;
  outline: none;
  border: none;
  transform: scale(0);
  background: transparent;
  transition: transform 0.2s ease;
}
.typing-form .typing-input:valid ~ #send-message-button {
  transform: scale(1);
}
.typing-area .disclaimer-text {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 1rem;
  color: var(--placeholder-color);
}
/* Responsive media query code for small screen */
@media (max-width: 768px) {
  .header :is(.title, .subtitle) {
    font-size: 2rem;
    line-height: 2.6rem;
  }
  .header .subtitle {
    font-size: 1.7rem;
  }
  .typing-area :where(.typing-form, .action-buttons) {
    gap: 0.4rem;
  }
  .typing-form .input-wrapper {
    height: 50px;
  }
  .typing-form .typing-input {
    padding: 1.1rem 3.5rem 1.1rem 1.2rem;
  }
  .typing-area .icon {
    height: 50px;
    width: 50px;
  }
  .typing-area .disclaimer-text {
    font-size: 0.75rem;
    margin-top: 0.5rem;
  }
  
}
/* Compact Lecture Cards Styles */

    
  
    .results-count {
      background: #e3f2fd;
      color: #1976d2;
      padding: 5px 10px;
      border-radius: 15px;
      font-size: 0.85em;
      font-weight: bold;
      margin-right: 10px;
    }
    
    .cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
      gap: 15px;
    }
    
   
    
    .card-title {
      margin: 0;
      font-size: 1.1em;
      font-weight: 600;
      line-height: 1.3;
      flex: 1;
      margin-left: 10px;
      color: var(--text-color);
      font-family: sans-serif;
      text-transform: capitalize;
    }
    
    .lecture-number {
      background: rgba(143, 141, 141, 0.2);
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 0.85em;
      font-weight: bold;
      white-space: nowrap;
    }
    .subject-name {
    display: flex;
      margin: 0;
      color: #495057;
      font-size: 0.95em;
    }
    
    .card-link {
      display: inline-flex;
      align-items: center;
      text-decoration: none;
      background-color: var(--secondary-color);
      color: var(--text-color);
      padding: 10px 15px;
      border-radius: 8px;
      font-weight: 500;
      transition: all 0.3s ease;
      width: 100%;
      height: fit-content;
      justify-content: center;
      direction: ltr;
    }
    
    .card-link:hover {
background: linear-gradient(135deg, #8e75c8 0%, #f39fdc 100%);      transform: translateY(-1px);
      box-shadow: 0 3px 10px rgba(40,167,69,0.3);
    }
    
   
    /* Dark mode support */
    .dark_mode .card-link  {
      background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
      border-color: #4a5568;
    }
    
   
    .dark_mode .results-count {
      background: #1e3a8a;
      color: #bfdbfe;
    }
    
    /* Responsive design */
    @media (max-width: 768px) {
      .cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
      }
      
      .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
      }
    }
    .r {
      margin-top: -51px;
    display: flex;
    }
    .lecture-mode-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  background-color: #ccc;
  color: #000;
  cursor: pointer;
  z-index: 1000;
  font-size: 14px;
  transition: background 0.3s;
}

.lecture-mode-btn.active {
  background-color: #007bff;
  color: #fff;
}
#button {
  font-family: monospace;
  font-size: 14px;
  text-transform: uppercase;
  width: 100px;
  margin-left: 20px;
  margin-bottom: 5px;
  border-radius: 9px;

  
}
#button {

  border: 1px solid;
  overflow: hidden;
  position: relative;
}
#button span {
  z-index: 20;
}
#button:after {
  background: #fff;
  content: "";
  height: 155px;
  left: -75px;
  opacity: 0.2;
  position: absolute;
  top: -50px;
  transform: rotate(35deg);
  transition: all 550ms cubic-bezier(0.19, 1, 0.22, 1);
  width: 50px;
  z-index: -10;
}

#button:hover:after {
  left: 120%;
  transition: all 550ms cubic-bezier(0.19, 1, 0.22, 1);
}

#exit-lecture-mode {
  border: none;
  width: 70px;
  font-size: 24px;
  background: transparent;
}
