/* =================================================================
   GLOBAL.CSS - Combined styles from index.html and blog.ejs
   =================================================================
   
   CẢNH BÁO - CONFLICTING CLASS NAMES:
   
   Các class sau đây có tên trùng nhau nhưng styles khác nhau:
   
   1. .container - Có 2 styles khác nhau (search page vs blog page)
   2. .search-input-wrapper - Có 2 styles khác nhau 
   3. .search-input - Có 2 styles khác nhau
   4. .search-icon-wrapper - Có 2 styles khác nhau
   5. .search-icon - Có 2 styles khác nhau
   6. .footer - Có 2 styles khác nhau (search page vs blog page)
   7. .footer-link - Có 2 styles khác nhau
   8. .blog-description - Có 2 styles khác nhau
   
   SOLUTION: Added modifier classes like .search-page-style, .blog-page-style
   
   ================================================================= */

/* CSS Variables - matching the tailwind config */
:root {
  --font-family: 'Inter', sans-serif;
  --primary: #26A4E3;
  --brand-color: #26A4E3;
  --brand-color-50: #F5F9FD;
  --brand-color-100: #E6F3FB;
  --brand-color-200: #CCE7F7;
  --brand-color-300: #B3DBF3;
  --brand-color-400: #99CFEF;
  --brand-color-500: #2395CF;
  --brand-color-600: #1B74A1;
  --brand-color-700: #176288;
  --brand-color-800: #0F415B;
  --brand-color-900: #07212D;
  --default-color-100: #F2F4F7;
  --default-color-200: #EAECF0;
  --default-color-300: #D0D5DD;
  --default-color-400: #475467;
  --default-color-500: #667085;
  --default-color-600: #475467;
  --default-color-700: #344054;
  --default-color-800: #1D2939;
  --default-color-900: #101828;
  --default-color-1000: #182230;
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: #333;
  background-color: #000; /* Default for search page */
  min-height: 100vh;
}

/* Body variations for different pages */
body.blog-page {
  background-color: white;
  color: #333;
}

body.search-page {
  background-color: #000;
  color: #fff;
  border-top: 3px solid #3b82f6;
}

/* =================================================================
   CONTAINER STYLES - CONFLICTING CLASS RESOLVED
   ================================================================= */

/* Container - Search Page Style (default) */
.container {
  min-height: 100vh;
  max-width: 768px;
  margin: 0 auto;
}

/* Container - Blog Page Style */
.container.blog-container {
  max-width: 1400px;
  min-height: auto;
  border-top: none;
  padding: 0 1rem;
}

/* =================================================================
   HEADER STYLES
   ================================================================= */

.header {
  width: 100%;
  background-color: white;
  position: relative;
  z-index: 50;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.logo-wrapper {
  width: 300px;
}

.logo {
  width: 139px;
  color: transparent;
}

.mobile-menu-btn {
  display: flex;
  background: none;
  border: none;
  color: var(--default-color-500);
  cursor: pointer;
}

.mobile-menu-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* =================================================================
   SEARCH STYLES - CONFLICTING CLASSES RESOLVED
   ================================================================= */

.search-container {
  display: none;
  min-width: 400px;
}

.search-group {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.search-main-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Search Input Wrapper - Blog Style (default) */
.search-input-wrapper {
  position: relative;
  width: 100%;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  gap: 0.75rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0 0.5rem;
  transition: all 0.15s ease;
  min-width: 300px;
  background: white;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: text;
}

/* Search Input Wrapper - Search Page Style */
.search-input-wrapper.search-page-style {
  max-width: 400px;
  min-width: 300px;
  padding: 12px 48px 12px 16px;
  border: 2px solid #374151;
  border-radius: 8px;
  background-color: #fff;
  height: auto;
  min-height: auto;
  gap: 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.search-input-wrapper:hover {
  background: white !important;
  border-color: #9ca3af;
}

.search-input-wrapper:focus-within {
  border-color: var(--default-color-900);
}

.search-input-wrapper.search-page-style:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-inner-wrapper {
  display: inline-flex;
  width: 100%;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
}

/* Search Input - Blog Style (default) */
.search-input {
  width: 100%;
  font-weight: 400;
  outline: none;
  border: none;
  background: transparent;
  padding-left: 0.375rem;
  padding-right: 0.375rem;
  font-size: 0.875rem;
  color: #333;
}

/* Search Input - Search Page Style */
.search-input.search-page-style {
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: #000;
}

.search-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.search-input.search-page-style::placeholder {
  color: #6b7280;
}

.search-input:focus {
  outline: none;
}

/* Search Icon Wrapper - Blog Style (default) */
.search-icon-wrapper {
  padding: 0.5rem;
}

/* Search Icon Wrapper - Search Page Style */
.search-icon-wrapper.search-page-style {
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #3b82f6;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.search-icon-wrapper.search-page-style:hover {
  background-color: #2563eb;
}

/* Search Icon - Blog Style (default) */
.search-icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  color: #9ca3af;
  pointer-events: none;
  flex-shrink: 0;
  font-size: 1.125rem;
}

/* Search Icon - Search Page Style */
.search-icon.search-page-style {
  width: 18px;
  height: 18px;
  color: #fff;
  transition: color 0.2s ease;
}

/* =================================================================
   SEARCH PAGE SPECIFIC STYLES
   ================================================================= */

.loading-screen {
  background-color: #000;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-header {
  position: relative;
}

.background-wrapper {
  position: relative;
  width: 100%;
  height: 80px;
  overflow: hidden;
}

.background-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.background-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.search-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 8px;
}

.content {
  padding: 0;
}

.ads-container {
  padding: 16px 0;
  margin-bottom: 24px;
}

.related-searches {
  padding: 16px 0;
}

.web-results {
  margin: 32px 0 16px 0;
}

.web-results-title {
  color: #fff;
  margin-bottom: 16px;
  font-size: 16px;
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  font-size: 14px;
}

.blog-item {
  color: #fff;
}

.blog-link {
  color: #fff;
  text-decoration: none;
}

.blog-link:hover {
  text-decoration: underline;
}

.blog-url {
  margin: 8px 0;
  padding-left: 4px;
  color: #9ca3af;
  font-size: 12px;
}

.pagination {
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  padding: 16px 0;
  margin: 32px 0;
  width: 100%;
}

.pagination-wrapper {
  display: flex;
  min-width: max-content;
  gap: 8px;
}

.pagination-link {
  min-width: 24px;
  text-align: center;
  padding: 4px 0;
  color: #3b82f6;
  text-decoration: none;
  white-space: nowrap;
}

.pagination-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.pagination-link.active {
  color: #2563eb;
  font-weight: 500;
  text-decoration: underline;
}

/* =================================================================
   BLOG PAGE SPECIFIC STYLES
   ================================================================= */

.blog-main {
  background-color: white;
  padding-bottom: 5rem;
}

.blog-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.blog-content-wrapper {
  width: 100%;
}

.blog-sidebar {
  width: 100%;
  order: 2;
}

.blog-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.blog-title {
  color: var(--default-color-1000);
  font-size: 1.25rem !important;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.blog-image {
  width: 100%;
  margin: 1rem 0;
  position: relative;
}

.blog-image img {
  width: 100%;
  height: auto;
  border-radius: 0.375rem;
  object-fit: cover;
}

/* Subscribe Card */
.subscribe-card {
  padding: 1rem;
  background-color: #F9FAFB;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.subscribe-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--default-color-900);
  margin: 0.4rem 0 !important;
}

.subscribe-description {
  color: var(--default-color-500);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.email-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.email-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--default-color-300);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: white;
  transition: border-color 0.2s;
}

.email-input:focus {
  outline: none;
  border-color: var(--brand-color-500);
}

.email-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--default-color-400);
  z-index: 1;
}

.subscribe-button {
  padding: 0.75rem 1rem;
  background: rgb(104 66 255);
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.subscribe-button:hover{
  background: rgb(223 94 250);
}

.privacy-text {
  font-size: 0.75rem;
  color: var(--default-color-400);
  text-align: center;
}

/* Author Card */
.author-card {
  background-color: white;
  border: 1px solid var(--default-color-200);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.author-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.author-avatar {
  margin-top: 0px;
  margin-bottom: 0px !important;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--default-color-900);
  margin: 0 0 0.25rem 0;
}

.author-date {
  font-size: 0.75rem;
  color: var(--default-color-500);
  margin: 0;
}

.author-bio {
  color: var(--default-color-600);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}

/* Blog Content */
.blog-content {
  color: var(--default-color-900);
  line-height: 1.6;
  font-size: 0.9rem;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
  margin: 1.25rem 0 0.75rem 0;
  color: var(--default-color-1000);
}

.blog-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.blog-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.blog-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.blog-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
}

.blog-content p {
  margin-bottom: 1rem;
}

.blog-content ul,
.blog-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.blog-content li {
  margin-bottom: 0.5rem;
}

.blog-content strong {
  font-weight: 700;
}

.blog-content a {
  color: var(--brand-color-500);
  text-decoration: underline;
}

.blog-content a:hover {
  color: var(--brand-color-600);
}

/* =================================================================
   FOOTER STYLES - CONFLICTING CLASS RESOLVED
   ================================================================= */

/* Footer - Search Page Style (default) */
.footer {
  margin-top: 64px;
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  padding: 16px 0;
}

/* Footer - Blog Page Style */
.footer.blog-page-style {
  background-color: #0C111D;
  color: white;
  padding-top: 2rem;
  margin-top: 0;
  text-align: left;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  border-bottom: 1px solid #374151;
  padding-bottom: 1.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.footer-nav {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
}

/* Footer Links - Search Page Style (default) */
.footer-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.footer-link {
  color: #9ca3af;
  text-decoration: none;
}

.footer-link:hover {
  color: #fff;
}

/* Footer Links - Blog Page Style */
.footer-link.blog-page-style {
  color: #CECFD2;
  font-weight: 500;
  font-size: 14px;
}

.footer-link.blog-page-style:hover {
  color: white;
}

.footer-separator {
  margin: 0 4px;
}

.footer-disclaimer {
  padding: 1.5rem 0;
}

.footer-disclaimer p {
  color: #94969C;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
}

.footer-copyright {
  color: #94969C;
  font-size: 14px;
}

.footer-socials {
  display: flex;
  gap: 0.5rem;
}

.social-link {
  color: #98A2B3;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-link:hover {
  color: white;
}

/* =================================================================
   BLOG DESCRIPTION STYLES - CONFLICTING CLASS RESOLVED
   ================================================================= */

/* Blog Description - Search Page Style (default) */
.blog-description {
  color: #d1d5db;
  line-height: 1.4;
}

/* Blog Description - Blog Page Style */
.blog-description.blog-page-style {
  color: var(--default-color-500);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

.hidden {
  display: none;
}

.min-h-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.p-content-blog {
  opacity: 0;
}

.envelope-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =================================================================
   RESPONSIVE STYLES
   ================================================================= */

/* Mobile Large - 480px+ */
@media (min-width: 480px) {
  .container.blog-container {
    padding: 0 1.25rem;
  }
  
  .search-input-wrapper {
    min-width: 280px;
  }
  
  .search-input-wrapper.search-page-style {
    min-width: 250px;
  }

  .header-container {
    padding: 0 1.25rem;
  }

  .blog-header {
    gap: 1rem;
  }

  .blog-title {
    font-size: 1.25rem;
  }

  .blog-description.blog-page-style {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .author-card {
    padding: 1.25rem;
    border-radius: 0.75rem;
  }

  .author-header {
    flex-direction: row;
    text-align: left;
    gap: 1rem;
  }

  .author-avatar {
    width: 48px;
    height: 48px;
  }

  .blog-content {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .blog-content h1 {
    font-size: 1.75rem;
  }

  .blog-content h2 {
    font-size: 1.5rem;
  }

  .blog-content h3 {
    font-size: 1.3rem;
  }

  .blog-content h4 {
    font-size: 1.15rem;
  }
}

/* Tablet Small - 640px+ */
@media (min-width: 640px) {
  .container.blog-container {
    padding: 0 1.5rem;
  }

  .footer {
    padding-top: 3rem;
  }
  
  .footer-container {
    padding: 0 1.5rem;
  }

  .footer-bottom {
    flex-direction: row;
  }

  .search-input-wrapper {
    min-width: 320px;
  }

  .header-container {
    padding: 0 1.5rem;
  }

  .blog-description.blog-page-style {
    font-size: 1rem;
  }
}

/* iPad/Tablet - 768px+ */
@media (min-width: 768px) {
  .container.blog-container {
    padding: 0 2rem;
  }

  .footer-container {
    padding: 0 2rem;
  }

  .footer-main {
    flex-direction: row;
  }

  .header-container {
    padding: 0 2rem;
  }

  .header-content {
    height: 5rem;
  }

  .search-container {
    display: block;
  }

  .mobile-menu-btn {
    display: none;
  }

  .search-input-wrapper {
    min-width: 350px;
  }


  .blog-layout {
    gap: 2rem;
  }

  .blog-sidebar {
    width: 280px;
    flex-shrink: 0;
    order: 0;
  }

  .blog-header {
    gap: 1.5rem;
  }


  .blog-description.blog-page-style {
    font-size: 0.9rem;
  }

  .subscribe-card {
    padding: 1.5rem;
  }

  .author-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .author-avatar {
    width: 52px;
    height: 52px;
  }

  .blog-content {
    font-size: 1rem;
    line-height: 1.7;
  }

  .blog-content h1,
  .blog-content h2,
  .blog-content h3,
  .blog-content h4,
  .blog-content h5,
  .blog-content h6 {
    margin: 1.5rem 0 1rem 0;
  }

  .blog-content h1 {
    font-size: 2rem;
  }

  .blog-content h2 {
    font-size: 1.75rem;
  }

  .blog-content h3 {
    font-size: 1.5rem;
  }

  .blog-content h4 {
    font-size: 1.25rem;
  }
}

/* iPad Pro/Small Laptop - 1024px+ */
@media (min-width: 1024px) {
  .container.blog-container {
    padding: 0 3rem;
  }

  .footer-container {
    padding: 0 4rem;
  }

  .header-container {
    padding: 0 3rem;
  }

  .search-input-wrapper {
    min-width: 380px;
  }
  .blog-layout {
    flex-direction: row;
    gap: 2.5rem;
  }

  .blog-sidebar {
    width: 280px;
  }

  .blog-header {
    gap: 2rem;
  }


  .blog-description.blog-page-style {
    font-size: 1rem;
  }
}

/* Laptop - 1280px+ */
@media (min-width: 1280px) {
  .container.blog-container {
    padding: 0 4rem;
  }

  .footer-container {
    padding: 0 8rem;
  }

  .header-container {
    padding: 0 4rem;
  }

  .search-input-wrapper {
    min-width: 400px;
  }

  .blog-title {
    font-size: 1.75rem;
  }

}

/* Desktop - 1440px+ */
@media (min-width: 1440px) {
  .container.blog-container {
    padding: 0 6rem;
  }

  .header-container {
    padding: 0 6rem;
  }

  .search-input-wrapper {
    min-width: 450px;
  }

  .author-card {
    padding: 2rem;
  }

  .author-avatar {
    width: 56px;
    height: 56px;
  }

  .blog-content {
    font-size: 1.1rem;
    line-height: 1.75;
  }

  .blog-content h1 {
    font-size: 2.25rem;
  }

  .blog-content h2 {
    font-size: 2rem;
  }

  .blog-content h3 {
    font-size: 1.75rem;
  }

  .blog-content h4 {
    font-size: 1.5rem;
  }
}

/* Large Desktop - 1536px+ */
@media (min-width: 1536px) {
  .container.blog-container {
    padding: 0 8rem;
  }

  .header-container {
    padding: 0 8rem;
  }

  .search-input-wrapper {
    min-width: 500px;
  }

}

/* Mobile specific overrides */
@media (max-width: 768px) {
  .search-input-wrapper {
    min-width: 250px;
  }

  .footer-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
} 
