/* Additional custom styles for better responsiveness and animations */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');

/* Smooth animations for interactions */
* {
  transition: all 0.2s ease-in-out;
}
/* Custom gradient background for the logo */
.logo-gradient {
  background: linear-gradient(135deg, #60a5fa 0%, #a855f7 100%);
}

/* Glass morphism effect for the card */
.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Focus states for better accessibility */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 0 0 4px rgba(255, 255, 255, 0.2);
}

/* Hover effects for buttons */
.btn-hover:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}


@media only screen and (max-width: 1400px) {
  body.min-h-screen {
    overflow: auto !important;
  }
}
/* Mobile-first responsive breakpoints */
@media (max-width: 640px) {
  .mobile-card {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .mobile-title {
    font-size: 2rem;
    line-height: 2.5rem;
  }
  
  .mobile-input {
    height: 60px;
    font-size: 1rem;
  }
  
  .mobile-button {
    height: 60px;
    font-size: 1rem;
  }
}

/* Tablet responsive adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
  .tablet-card {
    max-width: 500px;
    padding: 2rem;
  }
}

/* Desktop enhancements */
@media (min-width: 1025px) {
  .desktop-card {
    max-width: 560px;
  }
  
  /* Subtle animation for the background pattern */
  .bg-pattern {
    animation: float 20s ease-in-out infinite;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

/* Custom checkbox styling */
.custom-checkbox {
  appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid #9ca3af;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  align-items: center;
}

.custom-checkbox:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

.custom-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

/* Loading states */
.loading {
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* Improved focus indicators for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .glass-card {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ffffff;
  }
  
  input, button {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:root {
  --darkbg:#251D29;
  --darkt: #FFD1F7;
  --lightbg: #fff;
  --lightt: #D43370;
  
  --toggleHeight: 16em;
  --toggleWidth: 30em;
  --toggleBtnRadius: 10em;

  --bgColor--night: #423966;
  --toggleBtn-bgColor--night: var(--bgColor--night);
  --mooncolor: #D9FBFF;
  --bgColor--day: #9ee3fb;
  --toggleBtn-bgColor--day: var(--bgColor--day);
}

.tdnn {
  margin: 0 auto;
  /*change size of toggle with font-size*/
  font-size: 18%;
   position: relative;
    height: var(--toggleHeight);
    width: var(--toggleWidth);
    border-radius: var(--toggleHeight);
  transition: all 500ms ease-in-out;
  background: var(--bgColor--night);
}
.day{
  background: #FFBF71;
}
.moon {
  position: absolute;
  display: block;
  border-radius: 50%;
  transition: all 400ms ease-in-out;
  
  top: 3em;
  left: 3em;
  transform: rotate(-75deg);
  width: var(--toggleBtnRadius);
  height: var(--toggleBtnRadius);
  background: var(--bgColor--night);
  box-shadow: 
    3em 2.5em 0 0em var(--mooncolor) inset,
    rgba(255, 255, 255, 0.1) 0em -7em 0 -4.5em,
    rgba(255, 255, 255, 0.1) 3em 7em 0 -4.5em,
    rgba(255, 255, 255, 0.1) 2em 13em 0 -4em,
    rgba(255, 255, 255, 0.1) 6em 2em 0 -4.1em,
    rgba(255, 255, 255, 0.1) 8em 8em 0 -4.5em,
    rgba(255, 255, 255, 0.1) 6em 13em 0 -4.5em,
    rgba(255, 255, 255, 0.1) -4em 7em 0 -4.5em,
    rgba(255, 255, 255, 0.1) -1em 10em 0 -4.5em;
}
.sun {
  top: 4.5em;
  left: 18em;
  transform: rotate(0deg);
  width: 7em;
  height: 7em;
  background: #fff;
  box-shadow: 3em 3em 0 5em #fff inset,
    0 -5em 0 -2.7em #fff,
    3.5em -3.5em 0 -3em #fff,
    5em 0 0 -2.7em #fff,
    3.5em 3.5em 0 -3em #fff,
    0 5em 0 -2.7em #fff,
    -3.5em 3.5em 0 -3em #fff,
    -5em 0 0 -2.7em #fff,
    -3.5em -3.5em 0 -3em #fff;
}

/** Dashboard chat custom css start here **/

/* Custom styles for the dashboard chat page */
body {
    font-family: 'Inter', sans-serif;
    /* max-width: 1920px;
    margin: 0 auto; */
    padding: 0;
    overflow: hidden;
}

.bg-image {
    background-image: url('../src/oplos-logo.png');
    background-position: 50.47% 0%;
    background-repeat: no-repeat;
    background-size: contain;
}

/* Sidebar styles */
.sidebar {
    transition: width 0.3s ease;
    width: 353px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.sidebar-content {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
}

.sidebar-toggle {
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
    opacity: 0;
    pointer-events: none;
}

.logo-container {
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.sidebar.collapsed .logo-container {
    cursor: pointer;
}

.logo-container:hover {
    transform: scale(1.05);
}

.sidebar.collapsed .logo-container:hover::after {
    content: 'Click to expand';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-top: 4px;
}

.main-content {
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 30px;
}

.new-chat-collapsed {
    display: none;
}

.sidebar.collapsed .new-chat-collapsed {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 10px;
}

/* Chat area styles */
.chat-container {
    height: calc(100vh - 220px);
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
    max-width: 1274px;
    margin: 0 auto;
    width: 100%;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.chat-message {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-message .message-avatar {
    background: #7fba00;
}

.message-content {
    flex: 1;
    line-height: 1.6;
    font-size: 16px;
}

.user-message {
    flex-direction: row-reverse;
    align-items:center
}

.user-message .message-content {
text-align: left;
padding: 12px 16px;
border-radius: 18px 18px 4px 18px;
max-width: fit-content;
/* margin-left: auto; */
width: 100% !important;
}

.ai-message .message-content {
    background: transparent;
    padding: 0;
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-message:hover .message-actions {
    opacity: 1;
}

.action-btn {
    padding: 4px 8px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.action-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Chat input styles */
.chat-input-area {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.chat-input-container {
    max-width: 1274px;
    margin: 0 auto;
    position: relative;
    backdrop-filter: blur(10px);
}

.blur-border {
    filter: blur(5px);
}

.gradient-border {
    border: 2px solid #ffb900;
}

/* Responsive styles */
@media (max-width: 1400px) {
    .chat-input-container {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -353px;
        z-index: 1000;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .chat-container {
        padding: 16px;
    }

    .user-message .message-content {
        max-width: 85%;
    }
}

/* History item styles */
.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    margin: 2px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.history-item:hover {
    background: rgba(255,255,255,0.1);
}
.history-item.active {
    background: rgb(169 169 169 / 20%);
    border: 1px solid #4e4e4e;
}
.history-icon {
    width: 10px;
    height: 10px;
    opacity: 0.7;
    flex-shrink: 0;
}

.history-text {
    font-size: 14px;
    font-weight: 300;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item.active .history-text {
    font-weight: 500;
}

.profile-dropdown {
    position: absolute;
    top: 60px;
    right: 20px;
    background: #2d2d2d;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 120px;
    z-index: 1000;
    display: none;
}

.profile-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 8px 16px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.1);
}

.timestamp {
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    margin: 20px 0;
}

/** Dashboard chat custom css over here **/

/* Apply to inputs, textareas, selects if you want — change selector as needed */
input:-internal-autofill-selected,
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  /* revert visual stuff */
  background-color: transparent !important;
  background-image: none !important;
  -webkit-box-shadow: none !important;

  -webkit-text-fill-color: inherit !important; /* Chrome text color */
  -webkit-text-size-adjust: none !important;

  /* stop autofill animation / color flash in Chrome */
  transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s !important;
}

@media only screen and (max-width: 1449px) and (min-width: 1026px) {
  .custom-checkbox {
  width: 12px !important;
  height: 12px !important;
}
}

@media only screen and (max-width: 675px){
  .tdnn {font-size: 14% !important;}
  .main-content.expanded {margin-left: 0px;}
}
