@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&display=swap');

body {
  font-family: 'Roboto', sans-serif;
  background-color: #f8f9fa;
  margin: 0;
}

.gmail-style-card {
  background-color: #ffffff;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 2px 0 rgba(60,64,67,.3),0 1px 3px 1px rgba(60,64,67,.15);
  border-radius: 8px;
  margin: 1.5rem auto;
  max-width: 900px;
  overflow: hidden;
}
.gmail-style-card.no-padding {
    padding: 0;
}

.search-header {
  background-color: #ffffff;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
}

.gmail-search-form {
  display: flex;
  align-items: center;
  background-color: #f1f3f4;
  border-radius: 24px;
  padding: 4px 8px;
  height: 48px;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.gmail-search-form:focus-within {
  background-color: #ffffff;
  box-shadow: 0 1px 3px 0 rgba(60,64,67,.3),0 2px 6px 2px rgba(60,64,67,.15);
}
.search-icon-button {
  background: none; border: none; padding: 8px; margin-right: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #5f6368;
}
.search-icon-button svg { fill: currentColor; }
.gmail-search-input {
  flex-grow: 1; border: none; background: none; padding: 8px 0;
  font-size: 16px; color: #3c4043; outline: none;
  font-family: 'Google Sans', sans-serif;
}
.gmail-search-input::placeholder { color: #5f6368; opacity: 1; }

/* --- Progress Bar Styles --- */
.progress-container {
    padding: 30px 24px; /* More padding */
    background-color: #ffffff;
    text-align: center;
}
.progress-bar-bg {
    background-color: #e9ecef; /* Light grey background */
    border-radius: 4px;
    height: 8px;
    overflow: hidden; /* Hide overflow of fill */
    margin-bottom: 12px; /* Space below bar */
    width: 80%; /* Make bar not full width */
    margin-left: auto;
    margin-right: auto;
}
.progress-bar-fill {
    background-color: #1a73e8; /* Google Blue */
    height: 100%;
    width: 0%; /* Start at 0 */
    border-radius: 4px;
    transition: width 0.8s ease-out; /* Smooth transition for width change */
}
.progress-status {
    font-family: 'Google Sans', sans-serif;
    font-size: 0.9rem;
    color: #5f6368;
    margin-top: 8px;
}
 .progress-error { /* Style for error shown during progress */
     margin: 15px 24px 0 24px; /* Match results padding */
     text-align: left; /* Align error text normally */
 }

.tab-container {
    border-top: 1px solid #e0e0e0;
}
.tab-buttons {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background-color: #ffffff;
    padding: 0 16px;
}
.tab-button {
    font-family: 'Google Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #5f6368;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 16px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -1px; /* Overlap border */
    white-space: nowrap;
}
.tab-button svg {
    fill: currentColor;
    opacity: 0.7;
    flex-shrink: 0; /* Prevent icon shrinking */
}
.tab-button:hover {
    background-color: #f8f9fa;
    color: #3c4043;
}
.tab-button.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}
 .tab-button.active svg {
     opacity: 1;
 }

.tab-content {
    display: none; /* Controlled by JS */
    padding: 0;
    background-color: #ffffff;
}
.tab-content.active { /* Use class to show active tab content */
     display: block;
 }

/* --- Results & Content Styling --- */
.results-container {
    padding: 20px 24px;
}
.assistant-results {
     padding-bottom: 16px; /* Add padding below assistant answer */
}
.status-message {
    font-size: 0.875rem;
    color: #5f6368;
    margin-bottom: 16px;
    padding-bottom: 8px;
}

.assistant-answer {
    line-height: 1.7;
    color: #3c4043;
    font-size: 0.95rem;
    font-family: 'Google Sans', sans-serif;
    border-left: 4px solid #4285F4;
    padding: 12px 20px 1px 20px;
    margin-top: 8px;
    margin-left: -4px;
}
.assistant-answer p { margin-bottom: 1.2em; }
.assistant-answer ul, .assistant-answer ol { margin-left: 1.5em; margin-bottom: 1.2em; padding-left: 1em; }
.assistant-answer li { margin-bottom: 0.6em; }
.assistant-answer li::marker { color: #4285F4; font-weight: bold; }
.assistant-answer a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dotted #1a73e8;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.assistant-answer a:hover { color: #185abc; border-bottom-style: solid; text-decoration: none; }
.assistant-answer code { font-family: monospace; background-color: #e8f0fe; padding: 3px 6px; border-radius: 4px; font-size: 0.88em; color: #174ea6; border: 1px solid #d2e3fc; }
.assistant-answer pre { background-color: #f1f3f4; padding: 1em; border-radius: 4px; overflow-x: auto; margin-bottom: 1em; border: 1px solid #e0e0e0; }
.assistant-answer pre code { background-color: transparent; padding: 0; border: none; color: #3c4043; }

/* --- Email List Styling (Now part of Results tab) --- */
.email-list-container {
    padding-top: 16px;
    border-top: 1px solid #e0e0e0; /* Separator line */
    margin-top: 20px; /* Space above email list */
 }
.email-list-heading {
    font-family: 'Google Sans', sans-serif;
    font-size: 0.875rem; color: #5f6368; font-weight: 500;
    margin-bottom: 12px; padding-bottom: 8px;
}
.gmail-results-list { list-style: none; padding: 0; margin: 0; }
.gmail-result-item { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f3f4; position: relative; }
.gmail-result-item:last-child { border-bottom: none; }
.gmail-result-item:hover { background-color: #f8f9fa; }
.result-sender-subject { flex-grow: 1; display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
.sender { font-weight: 500; color: #3c4043; font-size: 0.875rem; margin-right: 12px; min-width: 100px; max-width: 200px; /* Prevent sender taking too much space */ flex-shrink: 0; text-overflow: ellipsis; overflow: hidden; }
.subject { color: #5f6368; font-size: 0.875rem; text-overflow: ellipsis; overflow: hidden; }
.view-link { margin-left: 12px; color: #5f6368; text-decoration: none; flex-shrink: 0; opacity: 0.6; transition: opacity 0.2s ease; }
.gmail-result-item:hover .view-link { opacity: 1; }
.view-link svg { display: block; }

.no-results-message { color: #5f6368; padding: 20px 0; text-align: center; font-size: 0.875rem; }

/* --- About Tab Content Styling --- */
.about-content {
    line-height: 1.6;
    color: #3c4043;
    font-size: 0.9rem;
}
.about-content h4 {
    font-family: 'Google Sans', sans-serif;
    font-size: 1rem;
    color: #3c4043;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}
 .about-content h5 {
    font-family: 'Google Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #3c4043;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}
.about-content p, .about-content li {
    margin-bottom: 1em;
}
.about-content ul, .about-content ol {
    margin-left: 1.5em;
    padding-left: 1em;
    margin-bottom: 1.2em;
}
 .about-content ul { list-style: disc; }
 .about-content ol { list-style: decimal; }
 .about-content code { font-family: monospace; background-color: #e8f0fe; padding: 2px 5px; border-radius: 4px; font-size: 0.88em; color: #174ea6; border: 1px solid #d2e3fc; }
 .about-content em { font-style: italic; color: #5f6368; }


/* --- General Styles --- */
.alert { padding: 0.75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.25rem; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.gmail-button { display: inline-block; background-color: #1a73e8; color: #ffffff; font-weight: 500; font-size: 0.875rem; padding: 9px 23px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; text-align: center; text-decoration: none; transition: background-color 0.2s ease, box-shadow 0.2s ease; margin-top: 1rem; }
.gmail-button:hover { background-color: #185abc; box-shadow: 0 1px 2px 0 rgba(60,64,67,.3),0 1px 3px 1px rgba(60,64,67,.15); color: #ffffff; text-decoration: none; }
.gmail-button:focus { outline: none; box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.3); }

.footer-links { margin-top: 1.5rem; text-align: center; font-size: 0.875rem; padding-bottom: 1rem; }
.footer-links a { color: #1a73e8; text-decoration: none; margin: 0 10px; }
.footer-links a:hover { text-decoration: underline; }