﻿@tailwind base;
@tailwind components;
@tailwind utilities;

/* â”€â”€â”€ Base â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

@layer base {
  html { font-family: 'Inter', system-ui, sans-serif; }

  body {
    @apply bg-warm text-gray-800 antialiased;
    margin: 0;
  }

  h1, h2, h3, h4 { @apply tracking-tight; }

  a { @apply transition-colors duration-150; }
}

/* â”€â”€â”€ Components â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

@layer components {

  /* Buttons */
  .btn {
    @apply inline-flex items-center justify-center gap-2 font-semibold rounded-xl
           transition-all duration-150 cursor-pointer whitespace-nowrap
           text-sm px-5 py-2.5 no-underline;
  }
  .btn-primary {
    @apply btn bg-brand text-white border border-brand
           hover:bg-brand-hover hover:border-brand-hover;
  }
  .btn-secondary {
    @apply btn bg-white text-gray-700 border border-gray-200
           hover:bg-gray-50;
  }
  .btn-ghost {
    @apply btn bg-transparent text-gray-500 border border-transparent
           hover:bg-gray-100 hover:text-gray-700;
  }
  .btn-danger {
    @apply btn bg-white text-gray-600 border border-gray-200
           hover:bg-red-50 hover:border-red-200 hover:text-red-700;
  }
  .btn-sm {
    @apply text-xs px-3.5 py-2;
  }
  .btn-lg {
    @apply text-base px-6 py-3;
  }

  /* Cards */
  .card {
    @apply bg-white rounded-2xl border border-gray-100 shadow-soft p-6;
  }
  .card-hover {
    @apply card hover:shadow-soft-md hover:border-gray-200 transition-all duration-200;
  }

  /* Inputs */
  .input {
    @apply w-full border border-gray-200 rounded-xl px-4 py-3 text-gray-800
           placeholder-gray-400 bg-white text-sm
           focus:outline-none focus:ring-2 focus:ring-brand/20 focus:border-brand
           transition-colors duration-150;
  }
  .input-textarea {
    @apply input resize-none;
  }
  .label {
    @apply block text-sm font-medium text-gray-700 mb-1.5;
  }

  /* Badges */
  .badge {
    @apply inline-flex items-center text-xs font-semibold px-2.5 py-1 rounded-full;
  }
  .badge-brand    { @apply badge bg-brand text-white; }
  .badge-mint     { @apply badge bg-mint-light text-brand border border-mint; }
  .badge-lavender { @apply badge bg-lavender-light text-lavender-dark border border-lavender; }
  .badge-red      { @apply badge bg-red-50 text-red-700 border border-red-200; }
  .badge-green    { @apply badge bg-mint-light text-green-800 border border-mint; }

  /* Page layout */
  .page {
    @apply min-h-screen bg-warm py-10 px-5;
  }
  .page-inner {
    @apply max-w-5xl mx-auto;
  }
  .max-width {
    @apply max-w-5xl mx-auto;
  }

  /* Section headings */
  .page-title {
    @apply text-4xl font-bold text-gray-900 tracking-tight;
  }
  .page-subtitle {
    @apply text-gray-400 text-sm font-medium;
  }
  .page-description {
    @apply text-gray-500 text-base leading-relaxed max-w-2xl;
  }

  /* Grids */
  .grid-2 {
    @apply grid grid-cols-1 gap-5 sm:grid-cols-2;
  }
  .grid-3 {
    @apply grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3;
  }

  /* Flash messages */
  .flash-notice {
    @apply max-w-2xl mx-auto mt-5 px-4 py-3 rounded-xl text-sm text-center
           bg-mint-light text-brand border border-mint;
  }
  .flash-alert {
    @apply max-w-2xl mx-auto mt-5 px-4 py-3 rounded-xl text-sm text-center
           bg-red-50 text-red-700 border border-red-200;
  }
  .flash-warning {
    @apply max-w-2xl mx-auto mt-5 px-4 py-3 rounded-xl text-sm
           bg-amber-50 text-amber-800 border border-amber-200;
  }

  /* Nav links */
  .nav-link {
    @apply text-gray-500 font-semibold text-sm px-3.5 py-2 rounded-xl
           no-underline transition-colors duration-150
           hover:bg-gray-100 hover:text-gray-700;
  }
  .nav-link-active {
    @apply text-gray-900 bg-brand-light;
  }

  /* Auth card (login / signup) */
  .auth-page {
    @apply min-h-screen bg-warm py-12 px-5 flex items-start justify-center;
  }
  .auth-card {
    @apply card w-full max-w-md shadow-soft-md;
  }

  /* Glass nav bar */
  .ps-nav {
    @apply sticky top-0 z-50 backdrop-blur-md border-b border-[#d4e8da]
           bg-[rgba(250,250,250,0.97)];
  }
}

/* â”€â”€â”€ Chat layout (preserved) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.ps-chat-page {
  background: #fafafa;
  min-height: 100vh;
  padding: 40px 20px;
}

.ps-chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
}

@media (max-width: 640px) {
  .ps-chat-page {
    padding: 0 !important;
    min-height: unset !important;
    height: calc(100vh - 56px);
    height: calc(100svh - 56px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .ps-chat-page .ps-chat-wrap {
    flex: 1;
    min-height: 0;
    height: auto;
    padding: 12px 16px 0 16px;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .ps-chat-page .ps-chat-wrap > div:first-child {
    flex-shrink: 0;
    margin-bottom: 12px !important;
  }

  .ps-chat-page #messages,
  .ps-chat-page #group-messages {
    margin-bottom: 8px !important;
    padding-bottom: 16px !important;
  }

  .ps-chat-page #message-form {
    flex-shrink: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .ps-chat-page #group-message-form {
    flex-shrink: 0;
    margin-left: -16px;
    margin-right: -16px;
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* â”€â”€â”€ Edit profile sidebar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

@media (max-width: 640px) {
  .ps-edit-sidebar      { display: none !important; }
  .ps-edit-back-mobile  { display: block; }
}

