.capsule{
    color: var(--ppl-blaze-orange);
}

/* ==== Test Response Messages ==== */
.test-response {
    margin-top: 15px;
    text-align: center;
}

.response-message {
    padding: 12px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    display: none;
    transition: opacity 0.5s ease-in-out;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==== Loading Spinner ==== */
.loading-spinner {
    display: none; /* Hide initially */
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--ppl-blaze-orange);
    margin-top: 10px;
}

.spinner {
    border: 3px solid var(--ppl-blaze-orange);
    border-top: 3px solid var(--ppl-blaze-orange);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
    margin-right: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* details page */
.drug-details {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.drug-details.open {
    max-height: 1500px; /* large enough to fit content */
    opacity: 1;
}

.drug-toggle-wrapper {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

/* ==== Modal Background with Blur ==== */
.test-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Darker overlay */
    backdrop-filter: blur(8px); /* Blurred background effect */
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease-in-out;
    z-index: 2100;
}

/* ==== Modal Content Styling ==== */
.test-modal-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
    max-height: 80vh; /* Prevents overflow */
    overflow-y: auto; /* Enables scrolling */
}

.auto-expand {
    width: 100%;
    min-height: 40px;
    max-height: 200px; /* Prevent excessive growth */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    overflow-y: hidden; /* Hide scrollbar */
    resize: none; /* Prevent manual resizing */
    transition: height 0.2s ease-in-out;
}

.drug-name {
    color: var(--ppl-deep-sea-green);
    font-weight: bold;
}

/* Close Button Container */
.closing-container {
    position: relative;
    display: flex; 
    justify-content:center; 
    align-items: center;  
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Close Button */
.close {
    font-size: 100px;
    cursor: pointer;
    color: #28a745;
    transition: color 0.3s ease-in-out;
    background: transparent;
    display: inline-block;
    line-height: 1;
}

/* Hover Effect */
.close:hover {
    color: red;
}

/* ==== Input Fields (Textareas) ==== */
.test-modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, height 0.2s ease-in-out;
    resize: none; /* Prevent manual resizing */
    overflow-y: hidden; /* Hide scrollbar */
    min-height: 40px;
    max-height: 200px; /* Prevent excessive growth */
}

/* ==== Focus Effect ==== */
.test-modal-content textarea:focus {
    border-color: #28a745;
    outline: none;
    box-shadow: 0px 0px 8px rgba(40, 167, 69, 0.5);
    background-color: #f8fff8; /* Slight green tint for focus */
}

/* ==== Placeholder Styling ==== */
.test-modal-content textarea::placeholder {
    color: #888;
    font-style: italic;
}

/* Smooth transition on focus */
.test-modal-content textarea:focus::placeholder {
    color: #28a745;
}

/* ==== Question Styling ==== */
.test-modal-content label {
    display: block;
    font-weight: bold;
    font-size: 18px;
    color: #333;
    margin-top: 15px;
}

/* ==== Prevent Background Scrolling when Modal is Open ==== */
.modal-open {
    overflow: hidden;
}

/* 🌟 Search Banner - Modern Gradient Look */
.search-container {
    background: transparent;
    margin: auto;
    padding: 35px;
    text-align: center;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ✨ Smooth Hover Effect */
.search-container:hover {
    transform: translateY(-3px);
}

/* =========================
   Search Section Header
   ========================= */

.search-container {
  text-align: center;
}

.search-title {
  position: relative;
  display: inline-block;

  margin: 0 0 12px;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  font-weight: 1000;
  letter-spacing: -0.5px;
  color: var(--ppl-mirage);
}

/* Orange stripe */
.search-title::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -10px;

  width: 56px;
  height: 4px;

  background-color: var(--ppl-blaze-orange);
  border-radius: 3px;
}

.search-subtitle {
  margin: 18px auto 0;
  max-width: 60ch;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(22, 35, 43, 0.75);
}

html[data-theme="dark"] .search-title{
  color: #fff;
}

html[data-theme="dark"] .search-subtitle{
  color: rgba(255, 255, 255, 0.92);
}

/* 🔍 Search Form */
.search-form {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* 🎯 Search Bar Input */
.search-bar {
    flex: 2;
    padding: 14px 18px;
    border: none;
    border-radius: 25px 0 0 25px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    border: 1px solid black;
}

/* 🌈 Input Focus Effect */
.search-bar:focus {
    outline: none;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

/* 🚀 Search Button */
.search-btn {
    flex: 1;
    background: var(--ppl-deep-sea-green);
    color: var(--ppl-wild-sand);
    border: none;
    padding: 14px 20px;
    border-radius: 0 25px 25px 0;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 💡 Hover Effect */
.search-btn:hover {
    transform: scale(1.05);
}

/* 📱 Responsive Adjustments */
@media (max-width: 768px) {
    .search-container {
        padding: 25px;
    }

    .search-title {
        font-size: 1.8rem;
    }

    .search-subtitle {
        font-size: 1rem;
    }

    .search-bar {
        font-size: 14px;
    }

    .search-btn {
        font-size: 16px;
    }
}


/* Flashcards */
.flashcard {
    /*background: linear-gradient(to top, #e9f5ec, transparent);*/
    background-color: rgb(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid black;
}

.flashcard:hover {
    transform: scale(1.02);;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.flashcard h6 {
    color: var(--flashcard-header-color);
    font-weight: bold;
    margin-bottom: 10px;
}

.flashcard p {
    color: var(--flashcard-body-text-color);
    margin-bottom: 8px;
    font-size: 14px;
}


/* Image Container */
.image-container {
    margin-bottom: 15px;
}

.drug-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #ddd;
}

/* =========================
   PharmaProLearn Pagination
   ========================= */

.pagination {
  gap: 4px;
  justify-content: center;
}

/* Base link style */
.pagination .page-link {
  border: 1px solid rgba(22, 35, 42, 0.08);
  background: #ffffff;
  color: var(--ppl-mirage);
  font-weight: 700;

  padding: 8px 14px;
  border-radius: 12px;

  transition: all 0.2s ease;
}

/* Hover */
.pagination .page-link:hover {
  background: var(--ppl-deep-sea-green);
  color: #ffffff;
  border-color: var(--ppl-deep-sea-green);
  transform: translateY(-2px);
}

/* Active page */
.pagination .page-item.active .page-link {
  background: var(--ppl-blaze-orange);
  border-color: var(--ppl-blaze-orange);
  color: #ffffff;
}

/* Disabled state */
.pagination .page-item.disabled .page-link {
  background: #f5f5f5;
  color: rgba(22, 35, 42, 0.35);
  border-color: rgba(22, 35, 42, 0.08);
  cursor: not-allowed;
}

/* Prev/Next buttons slightly emphasized */
.pagination .page-link[href*="page="] {
  font-weight: 800;
}

/* Smooth press effect */
.pagination .page-link:active {
  transform: translateY(0);
}


/* Floating Chat Icon */
.chat-float {
    position: fixed;
    bottom: 65px;
    left: 40px;
    background-color: var(--ppl-blaze-orange);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1000;
}

.chat-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.chat-float .chat-icon {
    max-height: 50px;   /* shrink it down */
    max-width: 50px;    /* optional, for square scaling */
    width: auto;        /* keep aspect ratio */
    height: auto;       /* keep aspect ratio */
    object-fit: contain;
}

/* Chat Popup */
.chat-popup {
    position: fixed;
    top: 10%;
    align-self: center;
    margin-left: 20px;
    max-width: 400px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 2000;
}

.chat-header {
    background-color: var(--ppl-deep-sea-green);
    color: #fff;
    padding: 10px 15px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0056b3;
}

.chat-header .close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 3.5rem;
    cursor: pointer;
}

.chat-body {
    display: flex;
    flex-direction: column;
    height: 400px;
    padding: 15px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f1f1f1;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #007bff;
    border-radius: 4px;
}

.chat-messages .user-message,
.chat-messages .reply-message {
    margin: 5px 0;
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.chat-messages .user-message {
    background-color: #d1ecf1;
    align-self: flex-end;
}

.chat-messages .reply-message {
    background-color: #e9ecef;
    align-self: flex-start;
}

#chatInput {
    width: 100%;
    height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    resize: none;
    margin-bottom: 10px;
}

.ass-close-btn{
    color: var(--ppl-wild-sand);
    background-color: transparent;
    border: none;
    font-size: 5rem;
}

.send-btn {
    background-color: var(--ppl-deep-sea-green);
    color: #fff;
    border: none;
    padding: 12px;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    width: 100%;
}

.send-btn:hover {
    transform: translateY(-3%);
}

/* Tooltip for Floating Icon */
.chat-float[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-30%);
    background-color: var(--ppl-deep-sea-green);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 1100;
    margin-left: 20px;
}
