/* New section for safe area handling */

/* Define custom properties for safe areas */
:root {
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
}

/* Add padding for devices with notches */
.has-notch .base-header {
  padding-top: calc(var(--safe-area-inset-top) + 10px);
}

.has-notch .message-input-container {
  padding-bottom: calc(var(--safe-area-inset-bottom) + 10px);
}

/* Implement CSS custom property for viewport height */
:root {
  --vh: 1vh;
}

/* Use the custom property instead of vh */
@media (max-width: 767px) {
  .main-container {
    height: calc(100 * var(--vh) - 64px) !important;
  }
  
  .chat-container {
    height: calc(100 * var(--vh) - 64px);
    max-height: calc(100 * var(--vh) - 64px);
  }
}

/* Fix for iOS devices */
@supports (-webkit-touch-callout: none) {
  .main-container,
  .chat-container {
    /* Use the custom property for viewport height */
    height: calc(100 * var(--vh) - 64px) !important;
    max-height: calc(100 * var(--vh) - 64px) !important;
  }
  
  /* Ensure the input container is always accessible */
  .message-input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding-bottom: max(var(--safe-area-inset-bottom), 10px);
  }
}

/* Header Navigation Links */
header nav a {
    color: #000000; /* Black color for menu items */
    text-decoration: none;
    transition: color 0.2s ease;
}

header nav a:hover {
    color: #E3175E; /* Original magenta on hover */
}

/* Fix text colors for better contrast */
.text-gray-700 {
    color: #000000 !important; /* Black instead of gray */
}

.hover\:text-\[\#F3175C\]:hover {
    color: #E3175E !important; /* Original magenta for hover */
}

/* Ensure proper contrast for all text elements */
body {
    color: #1a1a1a; /* Very dark gray for main text */
}

p, span, div {
    color: inherit;
}

/* Fix light gray text */
.text-gray-500 {
    color: #595959 !important; /* Darker gray for better contrast */
}

.text-gray-600 {
    color: #4a4a4a !important; /* Darker gray for better contrast */
}

/* Theme Toggle Button Styles */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    color: #374151;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    transform: scale(1.05);
}

/* Icon visibility */
.theme-toggle-btn .dark-icon,
.theme-toggle-btn .light-icon {
    font-size: 18px;
    transition: opacity 0.2s ease;
}

/* Default state - light mode */
body:not(.dark-mode) .theme-toggle-btn .dark-icon {
    display: block;
}

body:not(.dark-mode) .theme-toggle-btn .light-icon {
    display: none;
}

/* Dark mode state */
body.dark-mode .theme-toggle-btn .dark-icon {
    display: none;
}

body.dark-mode .theme-toggle-btn .light-icon {
    display: block;
}

/* Dark mode button styles */
body.dark-mode .theme-toggle-btn {
    color: #e5e7eb;
    border-color: #4b5563;
}

body.dark-mode .theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #6b7280;
}

/* Criar Assistente Button Styles */
header nav a[href*="build"] {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background-color: #E3175E;
    color: white !important;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

header nav a[href*="build"]:hover {
    background-color: #F3175C;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 23, 94, 0.3);
}

header nav a[href*="build"] i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Dark mode styles for Criar Assistente button */
body.dark-mode header nav a[href*="build"] {
    background-color: #E3175E;
    color: white !important;
}

body.dark-mode header nav a[href*="build"]:hover {
    background-color: #F3175C;
    color: white !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    header nav a[href*="build"] {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    header nav a[href*="build"] i {
        font-size: 0.875rem;
    }
}

/* Prevent Navigation Layout Shifts */
header nav {
    min-height: 40px; /* Reserve space for navigation */
}

header nav a,
header nav button {
    /* Prevent text from causing shifts */
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

/* Reserve space for dynamic elements */
.dropdown {
    position: relative;
}

.dropdown > button {
    width: 32px;
    height: 32px;
}

/* Prevent icon loading shifts */
.fas, .far, .fab {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

/* Base styles for AIkolab */

/* Icon Size Standards */
.icon, .icone {
  min-width: 20px;
  min-height: 20px;
}

/* Button icons */
.btn .icon, .btn .icone,
.button .icon, .button .icone {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
}

/* Navigation icons */
.nav .icon, .nav .icone,
.navbar .icon, .navbar .icone {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
}

/* Agent card icons */
.agent-card .icon, .agent-card .icone,
.agent-icon, .agent-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
}

/* Social media icons */
.social-icon, .social-media-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
}

/* Status icons */
.status-icon, .status-indicator {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
}

/* Action icons */
.action-icon, .action-button .icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
}

/* SVG icon scaling */
svg.icon, svg.icone {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

/* Icon spacing */
.icon + span, .icone + span,
span + .icon, span + .icone {
  margin-left: 8px;
}

/* Mobile icon adjustments */
@media (max-width: 640px) {
  .btn .icon, .btn .icone,
  .button .icon, .button .icone {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
  }
  
  .action-icon, .action-button .icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
  }
}

/* High DPI screen adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .icon, .icone {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Light Mode Agent Cards */
body:not(.dark-mode) .agent-card {
  background-color: #FAFAFA;
  color: #1a1a1a;
}

body:not(.dark-mode) .agent-title {
  color: #1a1a1a;
}

body:not(.dark-mode) .agent-description {
  color: #444444;
}

body:not(.dark-mode) .agent-card .text-gray-500,
body:not(.dark-mode) .agent-card .text-gray-600 {
  color: #6b7280;
}

body:not(.dark-mode) .agent-card .text-gray-700,
body:not(.dark-mode) .agent-card .text-gray-800 {
  color: #374151;
}

body:not(.dark-mode) .agent-stats-line {
  color: #666666;
  background-color: rgba(240, 240, 240, 0.8);
}

body:not(.dark-mode) .agent-chat-count {
  color: #666666;
}

body:not(.dark-mode) .agent-seu-badge {
  background-color: #f0f0f0;
  color: #666666;
}

body:not(.dark-mode) .post-count,
body:not(.dark-mode) .posts-count {
  color: #6b7280;
}

/* Base layout */ 
