/* Modern YKS Advisor Styles - Tailwind ile entegre */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto;
}

/* Page Layout */
.page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  overflow-y: auto;
}

.page.is-active {
  opacity: 1;
  pointer-events: auto;
}

.page.hidden {
  display: none;
}

/* Main Panel - Chat Interface */
#mainPanel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  max-height: calc(100vh - 40px);
}

/* Chat Messages Container */
#chatMessages {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  min-height: 0; /* Allow flex shrinking */
}

/* Quick Replies Container - Compact buttons */
#quickRepliesContainer {
  flex-shrink: 0;
  padding: 0.75rem; /* Reduced padding */
  margin: 0.5rem 0; /* Reduced margin */
  background-color: rgb(239 246 255); /* bg-blue-50 */
  border-radius: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem; /* Reduced gap */
}

/* Quick Reply Buttons - Smaller and more compact */
#quickRepliesContainer button {
  padding: 0.375rem 0.5rem; /* Smaller padding */
  font-size: 0.75rem; /* Smaller font */
  line-height: 1rem;
  font-weight: 600;
  background-color: white;
  border: 1px solid rgb(147 197 253); /* border-blue-300 */
  color: rgb(29 78 216); /* text-blue-700 */
  border-radius: 0.375rem;
  transition: background-color 0.15s ease-in-out;
  white-space: nowrap;
  flex-shrink: 0;
}

#quickRepliesContainer button:hover:not(:disabled) {
  background-color: rgb(239 246 255); /* hover:bg-blue-50 */
}

#quickRepliesContainer button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* University Cards - Interactive */
#resultsCardsContainer article {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

#resultsCardsContainer article:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Header - Üst kısım (sabitli) */
.main-panel > div:first-child {
  flex-shrink: 0;
  border-bottom: 1px solid rgb(226, 232, 240);
}

/* Chat Messages Container - Esnek, kendi içinde scroll yapan alan */
#chatMessages {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.5;
  gap: 16px;
  padding: 24px;
  min-height: 0;
}

#chatMessages > div {
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Scroll-to-cards Button - Ezilmemeli */
#scrollToCardsBtn {
  flex-shrink: 0;
  margin: 12px auto 0 auto;
}

/* Cards Grid - Ezilmemeli, kendi içinde scroll */
#cardsContainer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 280px;
  padding: 0 16px 16px 16px;
}

/* Composer bölümü (son alt div) - Ezilmemeli */
.main-panel > div:last-child {
  flex-shrink: 0;
  border-top: 1px solid rgb(226, 232, 240);
}

/* Scrollbar styling */
#chatMessages::-webkit-scrollbar,
.side-panel::-webkit-scrollbar,
.main-panel::-webkit-scrollbar {
  width: 8px;
}

#chatMessages::-webkit-scrollbar-track,
.side-panel::-webkit-scrollbar-track,
.main-panel::-webkit-scrollbar-track {
  background: transparent;
}

#chatMessages::-webkit-scrollbar-thumb,
.side-panel::-webkit-scrollbar-thumb,
.main-panel::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 4px;
}

#chatMessages::-webkit-scrollbar-thumb:hover,
.side-panel::-webkit-scrollbar-thumb:hover,
.main-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

/* Utility classes */
.is-hidden {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .page {
    padding: 10px;
  }
  
  #cardsContainer {
    grid-template-columns: 1fr;
  }
}

/* Animation support */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.5rem); }
}

.animate-bounce {
  animation: bounce 1s infinite;
}

