/* Header CSS từ trang chủ - Copy chính xác cho AllToTextAI */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables từ trang chủ */
:root {
  /* Colors */
  --color-primary: #2563eb;
  --color-white: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;

  /* Border radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.1);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;

  /* Z-index */
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
}

/* Body font */
body {
  font-family: var(--font-family);
}

/* Reset list styles - Copy từ trang chủ */
ul, ol {
  list-style: none;
}

/* =========================================
   HEADER COMPONENT
   ========================================= */
#main-header {
  background-color: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: var(--z-30);
  height: 4rem;
  display: flex;
  align-items: center;
}

#main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
}

.logo a {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.025em;
  text-decoration: none;
}

.nav-links {
  display: none; /* Hidden on mobile first */
  list-style: none; /* Xóa dấu chấm */
  margin: 0;
  padding: 0;
}

/* =========================================
   LANGUAGE SWITCHER COMPONENT - Copy chính xác từ trang chủ
   ========================================= */
.language-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 var(--space-2);
  position: relative;
  z-index: var(--z-10);
}

.lang-btn {
  width: 2rem;
  height: 2rem;
  margin: 0 var(--space-1);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-xs);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lang-btn.active {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.lang-btn:hover {
  background-color: var(--bg-secondary);
  transform: translateY(-2px);
}

.lang-btn:focus {
  box-shadow: var(--shadow-focus);
  outline: none;
}

.lang-btn.active:hover {
  background-color: var(--color-primary);
}

/* =========================================
   AUTH COMPONENT - Copy chính xác từ trang chủ
   ========================================= */
#auth-container-alltotextai {
  display: flex;
  align-items: center;
  min-height: 2.5rem; /* Chiều cao cố định tương đương với nút đăng nhập */
  min-width: 90px; /* Chiều rộng tối thiểu */
  justify-content: flex-end;
  position: relative;
  z-index: var(--z-20); /* Đảm bảo z-index cao hơn các thành phần khác */
}

#auth-button-alltotextai {
  padding: var(--space-2) var(--space-5);
  font-size: var(--font-size-sm);
  font-weight: 600;
  background-color: var(--color-primary);
  color: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  border: none;
  text-align: center;
  line-height: 1;
  display: inline-block;
  text-decoration: none;
}

#auth-button-alltotextai:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#user-info-alltotextai {
  display: flex;
  align-items: center;
  position: relative;
}

#user-avatar-alltotextai {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  cursor: pointer;
}

#user-initials-alltotextai {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

#user-name-alltotextai {
  font-weight: 500;
  display: none; /* Luôn ẩn trên mọi kích thước màn hình */
}

/* Usage Display */
#usage-display {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 500;
  padding: var(--space-1) var(--space-2);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-right: var(--space-2);
}

/* User dropdown menu */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 200px;
  z-index: var(--z-30);
  margin-top: 0.5rem;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: none;
}

.user-dropdown.active {
  display: block;
  animation: fadeIn var(--transition-fast) forwards;
}

.user-dropdown-header {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-color);
}

.user-dropdown-name {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.user-dropdown-email {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-body {
  padding: var(--space-2) 0;
}

.dropdown-item {
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
  transition: background-color var(--transition-fast);
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-size: var(--font-size-sm);
  cursor: pointer;
  text-decoration: none;
}

.dropdown-item:hover {
  background-color: var(--bg-secondary);
}

.dropdown-item i {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  width: 1.25rem;
}

/* =========================================
   RESPONSIVE DESIGN - Copy chính xác từ trang chủ
   ========================================= */
@media (min-width: 768px) {
  .nav-links {
    display: flex;
    gap: var(--space-6);
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .nav-links li {
    list-style: none;
  }

  .nav-links a {
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    text-decoration: none;
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--color-primary);
  }

  .nav-links a.active:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
  }
}

/* Animation keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fix for main content to account for sticky header - DISABLED */
/* .main styles moved to main.css to avoid conflicts */

/* Container style for header */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3);
  width: 100%;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  text-align: center;
  line-height: 1;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* =========================================
   DROPDOWN MENU STYLES
   ========================================= */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 10px;
    color: #666;
    transition: transform 0.2s;
}

.dropdown.open .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-toggle:hover {
    color: var(--color-primary);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 4px;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.app-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.app-info {
    flex: 1;
}

.app-name {
    font-weight: 500;
    font-size: 14px;
}

/* Responsive dropdown */
@media (max-width: 768px) {
    .dropdown-menu {
        left: -50px;
        min-width: 250px;
    }
}
