/* General Body & Typography */
body {
    font-family: 'Inter', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Lora', serif;
}

.font-lora {
    font-family: 'Lora', serif;
}

/* AI Response Content Formatting */
.ai-response-content h1,
.ai-response-content h2,
.ai-response-content h3,
.ai-response-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.ai-response-content p,
.ai-response-content li {
    margin-bottom: 1.25em;
}

.ai-response-content p:last-child,
.ai-response-content ul:last-child,
.ai-response-content ol:last-child {
    margin-bottom: 0;
}

/* Example 2: Badge-style citation */
.inline-citation {
    font-size: 0.7em;
    font-style: normal;
    color: #4338ca;           /* Indigo text (indigo-700) */
    background-color: #e0e7ff; /* Lighter Indigo background (indigo-200) */
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.inline-citation.inline-citation-quote {
    color: #047857;      /* green-800 */
    background-color: #d1fae5; /* green-200 */
}

/* Navigation */
.nav-link.active {
    color: #1f2937;
    border-bottom-color: #4338ca;
    /* Indigo 600 */
}

#mobile-menu .nav-link.active {
    background-color: #eef2ff;
    /* indigo-50 */
    border-bottom-color: transparent;
}

.group:hover .group-hover\:block {
    display: block;
}

.group-hover\:block a.nav-link.active {
    border-bottom-color: transparent;
    background-color: #eef2ff; /* indigo-50 */
}


/* Common UI Components */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border-left-color: #4a5568;
    animation: spin 1s ease infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Page: AI Philosopher (index6.html) */
.tone-selector {
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    padding: 4px 8px;
    background-color: #f9fafb;
    cursor: pointer;
}

.feedback-btn:disabled {
    cursor: default;
}

/* Page: Library (library.html) - OLD STYLES*/
.filter-btn {
    transition: all 0.2s ease-in-out;
}

.filter-btn.active {
    background-color: #4338ca;
    /* Indigo 700 */
    color: white;
    border-color: #4338ca;
}

/* Page: Library (library.html) - NEW STYLES */
mark.search-highlight {
    background-color: #fef9c3; /* yellow-100 */
    color: inherit;
    padding: 2px 1px;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

mark.active-highlight {
    background-color: #fde047; /* yellow-400 */
}

p.initial-focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.5); /* Indigo-600 ring */
    transition: box-shadow 0.4s ease-in-out;
    border-radius: 4px; /* Optional: adds slightly rounded corners to the highlight box */
}


/* Page: Saved Conversation (chat_view.html) */
.popup {
    position: absolute;
    z-index: 50;
    display: none;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    /* gray-200 */
    width: 320px;
}

.popup.visible {
    display: block;
}

.popup-content {
    padding: 1rem;
    padding-top: 2.5rem;
    /* Make space for close button */
}

.popup textarea {
    width: 100%;
    height: 100px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    /* gray-300 */
    border-radius: 6px;
    resize: none;
    font-size: 14px;
    color: #1f2937;
    background-color: #f9fafb;
    /* gray-50 */
}

.popup textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px #c7d2fe;
    /* ring-indigo-200 */
    border-color: #4f46e5;
    /* indigo-600 */
}

.popup-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.popup-footer button {
    background-color: #4338ca;
    color: white;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.popup-footer button:hover {
    background-color: #3730a3;
}

.popup-close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    /* gray-400 */
    z-index: 10;
}

.popup-close-btn:hover {
    color: #1f2937;
    /* gray-800 */
}

.popup-delete-btn {
    color: #9ca3af;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: none;
    /* Hidden by default */
}

.popup-delete-btn:hover {
    color: #ef4444;
    /* red-500 */
}

.popup-delete-btn.visible {
    display: inline-block;
}

mark {
    background-color: #fef9c3;
    /* yellow-100 */
    padding: 2px 0;
    border-radius: 2px;
    cursor: pointer;
}


/* Page: Saved Notes (notes.html) */
.note-content {
    display: none;
    background-color: #f3f4f6;
    /* gray-100 */
}

/* Pages: Advice & Practice Plans (article listing pages) */
.article-list {
    list-style-type: none;
    padding-left: 0;
    margin-top: 2rem;
}

.article-list a {
    display: block;
    padding: 1.1rem 0.5rem;
    font-family: 'Lora', serif;
    font-size: 1.0rem;
    font-weight: 500;
    color: #4338ca; /* CHANGED: Default text color is now purple */
    text-decoration: none;
    /* Transition only the background for a clean effect */
    transition: background-color 0.2s ease-in-out;
}

.article-list a::before {
    content: '→';
    margin-right: 0.75rem;
    color: #4338ca; /* CHANGED: Default arrow color is now purple */
}

/* The hover effect now ONLY changes the background */
.article-list a:hover {
    background-color: #fafafa; /* Light gray background */
    /* The purple text and arrow color are inherited from the default state */
}

/* Page: Article view (template) */
.prose .inline-citation {
    font-size: 0.8em;
    color: #6b7280;
    /* gray-500 */
    font-style: italic;
    margin-left: 2px;
}

.key-passages {
    margin-top: 2.5rem;
    background-color: #f9fafb;
    /* gray-50 */
    border-left: 4px solid #c7d2fe;
    /* indigo-200 */
    padding: 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
    /* rounded-r-lg */
}

.key-passages-title {
    font-size: 0.75rem;
    /* text-xs */
    font-weight: 600;
    /* font-semibold */
    color: #6b7280;
    /* gray-500 */
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.key-passages blockquote {
    font-size: 1rem;
    /* text-base */
    font-style: italic;
    color: #374151;
    /* gray-700 */
    font-family: 'Lora', serif;
    margin: 0;
    padding: 0;
    border-left: none;
}

.key-passages cite {
    display: block;
    text-align: right;
    font-style: normal;
    font-size: 0.875rem;
    /* text-sm */
    color: #9ca3af;
    /* gray-400 */
    margin-top: 0.75rem;
}

.key-passages .passage-divider {
    border-top: 1px solid #e5e7eb;
    /* gray-200 */
    margin: 1.25rem 0;
}

/* --- NEW STYLES FOR PASSAGE TYPES --- */
.passage-label {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.passage-label-quote {
    background-color: #d1fae5; /* green-200 */
    color: #047857;      /* green-800 */
}

.passage-blockquote-quote {
    border-left-color: #34d399 !important; /* green-400 */
}

.passage-label-principle {
    background-color: #e0e7ff; /* indigo-200 */
    color: #3730a3;      /* indigo-800 */
}

.passage-blockquote-principle {
    border-left-color: #818cf8 !important; /* indigo-400 */
}
/* --- END NEW STYLES --- */


/* New, More Prominent Header Style - Add this to style.css */

.ai-response-content h2,
.prose h2 {
    font-size: 1.15rem;
    background-color: #eef2ff;    /* Keeps the light Indigo background */
    color: #3730a3;              /* Keeps the dark Indigo text */
    padding: 0.75rem 1rem;        /* Increases vertical padding slightly */
    border-radius: 0.375rem;      /* Keeps the rounded corners */
    margin-bottom: 1.5rem;        /* Keeps the space below */
    font-weight: 600;             /* Makes the font semi-bold */
    border-left: 5px solid #4338ca; /* Adds a decorative left border */
}

/* NEW STYLES FOR CONTENT TYPE LABELS */
.item-label {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
}

.label-chat {
    background-color: #e0e7ff; /* indigo-200 */
    color: #3730a3;      /* indigo-800 */
}

.label-practice {
    background-color: #d1fae5; /* green-200 */
    color: #047857;      /* green-800 */
}

.label-library {
    background-color: #fef3c7; /* amber-200 */
    color: #92400e;      /* amber-800 */
}

/* New Disclaimer Style */
.article-disclaimer {
    background-color: #f3f4f6; /* gray-100 */
    padding: 1rem;
    border-radius: 0.5rem; /* rounded-lg */
    margin-top: 2.5rem;
    font-size: 0.875rem; /* text-sm */
    color: #4b5563; /* gray-600 */
    border-left: 4px solid #d1d5db; /* gray-300 */
}

.article-disclaimer p {
    margin: 0;
}

/* --- NEW STYLES FOR ARTICLE PAGE ENHANCEMENTS --- */
.author-box {
    background-color: #f9fafb; /* gray-50 */
    padding: 1.25rem;
    border-radius: 0.5rem; /* rounded-lg */
    margin-top: 1.5rem;
    font-size: 0.875rem; /* text-sm */
    color: #374151; /* gray-700 */
    border-left: 4px solid #c7d2fe; /* indigo-200 */
}

.author-box-title {
    font-family: 'Lora', serif;
    font-weight: 600;
    color: #3730a3; /* indigo-800 */
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.author-box p {
    margin-bottom: 1em; /* Add space between paragraphs */
    line-height: 1.6;
}

.author-box p:last-child {
    margin-bottom: 0;
}

.author-box a {
    color: #4338ca; /* indigo-700 */
    text-decoration: none; 
    font-weight: 500;
}

.author-box a:hover {
    color: #3730a3; /* indigo-800 */
    text-decoration: underline; 
}

.prose .article-nav-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    color: #4338ca; /* indigo-700 */
    border: 1px solid #a5b4fc; /* indigo-300 */
    border-radius: 0.375rem; /* rounded-md */
    text-decoration: none;
    font-size: 0.875rem; /* text-sm */
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.prose .article-nav-btn:hover {
    background-color: #eef2ff; /* indigo-50 */
    color: #3730a3; /* indigo-800 */
    border-color: #c7d2fe; /* indigo-200 */
    text-decoration: none;
}

#share-twitter,
#share-facebook {
    text-decoration: none;
}
/* Custom Numbered List for Practice Plans */
.prose .day-list {
  list-style-type: none; /* Hide the original bullet points */
  padding-left: 0;
  counter-reset: day-counter; /* Create a new counter */
}

.prose .day-list > li {
  counter-increment: day-counter; /* Increment the counter for each list item */
  position: relative;
  padding-left: 40px; /* Make space for our custom number */
  margin-bottom: 2em; /* Add space between days */
}

.prose .day-list > li::before {
  content: counter(day-counter); /* Display the counter number */
  position: absolute;
  left: 0;
  top: 2px;
  
  /* --- Styling for the circle --- */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #4338ca; /* Indigo-700 */
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Adjusts the size of the main article title */
.prose h1 {
  font-size: 1.5rem; 
  line-height: 2.25rem;
}