/*
 * Mobile Responsive Styles for TaxHakr
 * These styles ONLY apply to mobile devices (max-width: 767px)
 * They do NOT affect desktop layouts
 */

/* ========================================
   BASE MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  /* Prevent horizontal scrolling */
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  /* Better touch targets - minimum 44px */
  button, 
  .btn, 
  a.btn,
  input[type="submit"],
  input[type="button"],
  .nav-link,
  .dropdown-item {
    min-height: 44px;
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
  }

  /* Improve form inputs for touch */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    min-height: 44px;
    padding: 0.75rem 1rem;
  }

  /* Make containers full width on mobile */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Fix Bootstrap row margins */
  .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }

  .row > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* ========================================
   NAVBAR MOBILE FIXES
   ======================================== */

@media (max-width: 767px) {
  /* Navbar height adjustment */
  .navbar {
    padding: 0.5rem 0;
  }

  .navbar-brand img {
    height: 32px;
  }

  /* Make navbar toggler larger for better touch */
  .navbar-toggler {
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
  }

  /* Mobile menu styling */
  .navbar-collapse.show,
  .navbar-collapse.collapsing {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1050;
  }

  .th-navbar .navbar-collapse {
    margin-top: 0;
    border-radius: 0;
  }

  /* Stack nav items vertically */
  .navbar-nav {
    padding: 1rem;
  }

  .navbar-nav .nav-item {
    margin: 0.25rem 0;
  }

  .navbar-nav .nav-link {
    padding: 0.75rem 1rem !important;
  }

  /* Full width buttons in mobile nav */
  .navbar-nav .th-btn-outline,
  .navbar-nav .th-btn-primary {
    width: 100%;
    text-align: center;
    margin: 0.5rem 0 !important;
  }

  /* Fix dropdown menus on mobile */
  .navbar-nav .dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    margin-top: 0;
    background: #f9fafb;
    border: none;
    box-shadow: none;
    padding: 0.5rem;
  }
}

/* ========================================
   DASHBOARD MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  /* Dashboard header */
  .dashboard-header {
    padding: 1.5rem 0;
    margin-bottom: 1rem;
    text-align: center;
  }

  .dashboard-title {
    font-size: 1.5rem !important;
    margin-bottom: 0.5rem;
  }

  .dashboard-subtitle {
    font-size: 0.9375rem;
  }

  /* Quick actions in header */
  .quick-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
  }

  /* Metric cards - stack vertically */
  .metric-card {
    min-height: auto;
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  .metric-value {
    font-size: 1.5rem;
  }

  .metric-value-small {
    font-size: 1rem;
  }

  /* Strategy summary card */
  .strategy-summary-card {
    padding: 1rem;
  }

  .strategy-content {
    padding-right: 0;
    margin-bottom: 1rem;
  }

  .strategy-title {
    font-size: 1.25rem;
  }

  .strategy-actions {
    margin-top: 1rem;
  }

  .strategy-actions .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* Strategy list items */
  .strategy-item {
    padding: 0.875rem;
    flex-wrap: wrap;
  }

  .strategy-number {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  .strategy-name {
    font-size: 0.875rem;
  }

  .strategy-savings {
    font-size: 0.75rem;
  }

  /* Dashboard sections */
  .dashboard-section {
    margin-bottom: 1rem;
  }

  .section-header {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .section-header h3,
  .section-header h4 {
    font-size: 0.9375rem;
  }

  .section-content {
    padding: 1rem;
  }

  /* Chat items */
  .chat-item {
    padding: 0.875rem;
    gap: 0.75rem;
  }

  .chat-icon {
    width: 36px;
    height: 36px;
  }

  .chat-title {
    font-size: 0.8125rem;
  }

  /* Checklist items */
  .checklist-item {
    padding: 0.625rem;
    font-size: 0.8125rem;
  }

  /* Topics list */
  .topic-item {
    padding: 0.625rem;
    font-size: 0.8125rem;
  }

  /* Hide animated circles on mobile for performance */
  .animated-circle {
    display: none !important;
  }

  /* Stats grid */
  .stats-row {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .stat-box {
    min-height: auto;
    padding: 1rem;
  }
}

/* ========================================
   ONBOARDING MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  /* Progress steps */
  .progress-steps {
    padding: 1rem 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 0.25rem;
  }

  .progress-step {
    min-width: auto;
    padding: 0.5rem;
    flex-shrink: 0;
  }

  .progress-step span:not(:first-child) {
    display: none;
  }

  .progress-connector {
    width: 20px;
    flex-shrink: 0;
  }

  /* Onboarding card */
  .onboarding-card {
    padding: 1.5rem 1rem;
    border-radius: 16px;
    margin: 0 0.5rem;
  }

  .onboarding-title {
    font-size: 1.5rem !important;
  }

  .onboarding-subtitle {
    font-size: 0.9375rem;
  }

  /* Drop zone */
  .drop-zone {
    padding: 2rem 1rem;
  }

  .drop-zone-text {
    font-size: 0.9375rem;
  }

  .drop-zone-hint {
    font-size: 0.8125rem;
  }

  /* Results section */
  .results-header {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .results-title {
    font-size: 1.125rem;
  }

  /* Analysis cards */
  .analysis-grid {
    gap: 1rem;
  }

  .analysis-card .card-header {
    padding: 1rem;
  }

  .analysis-card .card-header h3 {
    font-size: 0.875rem;
  }

  .analysis-card .card-body {
    padding: 1rem;
  }

  /* Opportunity rows */
  .opp-row {
    padding: 1rem 0;
    gap: 0.75rem;
  }

  .opp-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .opp-name {
    font-size: 0.875rem;
  }

  .opp-savings {
    font-size: 0.8125rem;
  }

  .opp-desc {
    font-size: 0.8125rem;
  }

  /* Forecast card */
  .forecast-card {
    padding: 1rem;
  }

  .forecast-top {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .forecast-total {
    text-align: center;
  }

  .forecast-chart-container {
    height: 160px;
  }

  /* Actions row */
  .actions-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .actions-row .btn-secondary,
  .actions-row .btn-primary {
    width: 100%;
    justify-content: center;
  }

  /* Hustle card */
  .hustle-card {
    padding: 1rem;
  }

  .hustle-title {
    font-size: 1.125rem;
  }

  .hustle-item-header {
    padding: 1rem;
  }

  .hustle-item-details {
    padding: 0 1rem 1rem 2.5rem;
  }
}

/* ========================================
   TEST DRIVE MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  .test-drive-page {
    padding-bottom: 2rem;
  }

  .td-hero {
    padding: 2rem 1rem;
  }

  .td-title {
    font-size: 2rem !important;
    line-height: 1.2;
  }

  .td-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .td-cta-group {
    width: 100%;
  }

  .td-btn-primary {
    width: 100%;
    justify-content: center;
    padding: 1rem 1.5rem;
  }

  .td-features {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem 2rem;
  }

  .td-feature {
    padding: 1.5rem;
  }

  /* Upload page */
  .td-container {
    padding: 1rem 0.5rem;
  }

  .td-content {
    padding: 0 0.5rem;
  }

  .td-header {
    margin-bottom: 1.5rem;
  }

  .td-heading {
    font-size: 1.5rem;
  }

  .td-upload-card,
  .td-questions-card {
    padding: 1.5rem 1rem;
    border-radius: 16px;
  }

  .td-upload-zone {
    padding: 2rem 1rem;
  }

  .td-upload-title {
    font-size: 1rem;
  }

  /* Floating shapes - hide on mobile */
  .td-shape {
    display: none;
  }
}

/* ========================================
   EXPERT & AFFILIATE DASHBOARD MOBILE
   ======================================== */

@media (max-width: 767px) {
  /* Common dashboard container */
  .expert-dashboard-container,
  .affiliate-dashboard-container {
    padding-bottom: 2rem;
  }

  /* Stats banner */
  .stats-banner {
    border-radius: 12px;
  }

  .stats-banner-inner {
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
  }

  .stat-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
  }

  .stat-item:last-child {
    border-bottom: none;
  }

  .stat-divider {
    display: none;
  }

  .stat-amount {
    font-size: 1.5rem;
  }

  /* Referral link card */
  .referral-link-card {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .referral-link-card .input-group {
    flex-direction: column;
    gap: 0.5rem;
  }

  .referral-link-card .form-control {
    border-radius: 8px !important;
    text-align: center;
  }

  .btn-copy {
    width: 100%;
    border-radius: 8px !important;
  }

  .referral-link-card .col-lg-5 {
    margin-top: 1rem;
  }

  .referral-link-card .d-flex {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-preview,
  .btn-customize {
    width: 100%;
    text-align: center;
  }

  /* Content cards */
  .content-card {
    border-radius: 12px;
    margin-bottom: 1rem;
  }

  .card-header-custom {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .card-body-custom {
    padding: 1rem;
  }

  /* Network tree */
  .network-tree {
    padding: 0.5rem;
  }

  .tree-node {
    padding: 0.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .node-avatar {
    width: 36px;
    height: 36px;
  }

  .node-info strong {
    font-size: 0.875rem;
  }

  .tree-children {
    padding-left: 1rem;
    margin-left: 0.75rem;
  }

  /* Transaction items */
  .transaction-item {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.875rem;
  }

  .transaction-icon {
    width: 36px;
    height: 36px;
  }

  .transaction-info {
    flex: 1 1 calc(100% - 50px);
  }

  .transaction-amount {
    flex: 1 1 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
  }

  /* Payout card */
  .payout-card {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .payout-icon {
    width: 40px;
    height: 40px;
  }

  .payout-date {
    font-size: 1.125rem;
  }

  /* Actions grid */
  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .action-btn {
    padding: 1rem;
  }

  .action-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .action-btn span {
    font-size: 0.75rem;
  }

  /* Appointments section */
  .appointments-section {
    border-radius: 12px;
  }

  .section-header {
    padding: 1rem;
  }

  .section-icon {
    width: 40px;
    height: 40px;
  }

  .appointment-item {
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .appointment-client {
    justify-content: flex-start;
  }

  .appointment-time {
    text-align: left;
    width: 100%;
    padding: 0.75rem;
  }

  .appointment-status {
    width: 100%;
    text-align: center;
  }

  .appointment-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-join-call,
  .btn-starts-soon {
    width: 100%;
    justify-content: center;
  }

  /* Affiliate earnings card */
  .affiliate-earnings-card {
    flex-direction: column;
    padding: 1.5rem 1rem;
    gap: 1.5rem;
    text-align: center;
  }

  .affiliate-stats-grid {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  .affiliate-stat-card {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    padding: 1rem;
  }

  .affiliate-stat-card .stat-value {
    font-size: 1.25rem;
  }

  /* Profile preview */
  .preview-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .btn-edit-profile {
    width: 100%;
  }
}

/* ========================================
   LOGGER/NUDGER MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  /* Tab navigation */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid #dee2e6;
  }

  .nav-tabs .nav-link {
    white-space: nowrap;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  /* Form cards */
  .logger-form-card {
    padding: 1rem;
    border-radius: 12px;
  }

  /* Log entries */
  .log-entry {
    padding: 0.875rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .log-entry-info {
    width: 100%;
  }

  .log-entry-amount {
    width: 100%;
    text-align: left;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
  }

  .log-entry-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }
}

/* ========================================
   TRACKER/TRANSACTIONS MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  /* Transactions table - convert to cards */
  .transactions-table {
    display: none !important;
  }

  .transactions-cards {
    display: block !important;
  }

  .transaction-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  .transaction-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
  }

  .transaction-card-merchant {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #111827;
  }

  .transaction-card-amount {
    font-weight: 700;
    font-size: 1rem;
  }

  .transaction-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
  }

  .transaction-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
  }

  /* Filters */
  .transaction-filters {
    flex-direction: column;
    gap: 0.75rem;
  }

  .transaction-filters select,
  .transaction-filters input {
    width: 100%;
  }

  /* Summary cards */
  .summary-cards {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* ========================================
   TAX CHATS MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  /* Chat container */
  .chat-container {
    height: calc(100vh - 70px);
    border-radius: 0;
  }

  /* Chat messages */
  .chat-messages {
    padding: 1rem;
  }

  .message {
    max-width: 90%;
    padding: 0.875rem 1rem;
  }

  .message.user {
    border-radius: 16px 16px 0 16px;
  }

  .message.assistant {
    border-radius: 16px 16px 16px 0;
  }

  /* Chat input */
  .chat-input {
    padding: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .chat-input textarea {
    padding: 0.75rem 1rem;
    font-size: 16px;
    border-radius: 12px;
  }

  .chat-input button {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  /* Topic selection */
  .topic-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .topic-card {
    padding: 1rem;
  }

  .topic-card .topic-icon {
    width: 40px;
    height: 40px;
  }

  .topic-card .topic-title {
    font-size: 0.8125rem;
  }
}

/* ========================================
   SUGGESTIONS MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  /* Suggestion cards */
  .suggestion-card {
    padding: 1rem;
    border-radius: 12px;
  }

  .suggestion-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .suggestion-title {
    font-size: 1rem;
  }

  .suggestion-savings {
    font-size: 0.9375rem;
  }

  .suggestion-actions {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .suggestion-actions .btn {
    width: 100%;
  }

  /* Filters */
  .suggestion-filters {
    flex-direction: column;
    gap: 0.5rem;
  }

  .suggestion-filters .btn-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .suggestion-filters .btn-group .btn {
    flex: 1;
  }
}

/* ========================================
   AUTH PAGES MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  /* Auth container */
  .auth-container {
    padding: 1rem;
    min-height: calc(100vh - 70px);
  }

  /* Auth card */
  .auth-card {
    padding: 1.5rem 1rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  }

  .auth-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .auth-subtitle {
    font-size: 0.9375rem;
  }

  /* Form fields */
  .auth-form .form-group {
    margin-bottom: 1rem;
  }

  .auth-form label {
    font-size: 0.875rem;
  }

  /* Social login buttons */
  .social-login-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .social-login-btn {
    width: 100%;
    padding: 0.875rem 1rem;
  }

  /* Divider */
  .auth-divider {
    margin: 1.5rem 0;
  }

  /* Links */
  .auth-links {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
}

/* ========================================
   ADMIN PAGES MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  /* Admin sidebar - convert to top nav on mobile */
  .admin-sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: auto;
    max-height: 60vh;
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 1040;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }

  .admin-sidebar.active {
    transform: translateY(0);
  }

  .admin-main {
    margin-left: 0;
    padding: 1rem;
  }

  /* Admin cards */
  .admin-card {
    padding: 1rem;
    border-radius: 12px;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .admin-stat-card {
    padding: 1rem;
  }

  .admin-stat-value {
    font-size: 1.25rem;
  }

  /* Admin tables - convert to cards */
  .admin-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-table {
    min-width: 600px;
    font-size: 0.8125rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.625rem 0.5rem;
    white-space: nowrap;
  }

  /* Admin filters */
  .admin-filters {
    flex-direction: column;
    gap: 0.75rem;
  }

  .admin-filters select,
  .admin-filters input {
    width: 100%;
  }

  .admin-filters .btn-group {
    width: 100%;
  }
}

/* ========================================
   LANDING PAGE MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  /* Hero section */
  .hero {
    padding: 60px 0;
  }

  .hero h1 {
    font-size: 2rem !important;
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .hero h2 {
    font-size: 1.75rem !important;
    line-height: 1.2;
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  /* CTA buttons */
  .cta-btn,
  .cta-primary {
    width: 100%;
    justify-content: center;
    padding: 1rem 1.5rem;
  }

  .cta-secondary-group {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .cta-secondary,
  .cta-tertiary {
    width: 100%;
    justify-content: center;
  }

  /* Features grid */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* How it works */
  .how-it-works-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Topic carousel */
  .topic-carousel {
    padding: 40px 0;
  }

  .marquee-item {
    padding: 0 10px;
  }

  .topic-card {
    padding: 1.25rem;
    min-width: 260px;
  }

  /* Persona preview cards */
  .persona-examples {
    padding: 40px 0;
  }

  .persona-preview-card {
    margin-bottom: 1rem;
  }

  .persona-preview-stats {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Matrix animation - hide on mobile */
  .matrix-animation {
    display: none !important;
  }

  /* Decorative elements - hide on mobile */
  .animate-blob {
    display: none !important;
  }
}

/* ========================================
   FOOTER MOBILE STYLES
   ======================================== */

@media (max-width: 767px) {
  footer {
    padding: 40px 0 20px;
  }

  .footer-brand-message {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }

  .footer-headline {
    font-size: 1rem;
  }

  .footer-description {
    font-size: 0.875rem;
  }

  .footer-links {
    margin-bottom: 1.5rem;
    text-align: center;
  }

  .footer-links h5 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .footer-links li {
    margin-bottom: 0.5rem;
  }

  .copyright {
    text-align: center;
    font-size: 0.8125rem;
  }
}

/* ========================================
   UTILITY MOBILE CLASSES
   ======================================== */

@media (max-width: 767px) {
  /* Hide on mobile */
  .hide-mobile {
    display: none !important;
  }

  /* Show only on mobile */
  .show-mobile {
    display: block !important;
  }

  /* Full width on mobile */
  .w-mobile-100 {
    width: 100% !important;
  }

  /* Text center on mobile */
  .text-mobile-center {
    text-align: center !important;
  }

  /* Stack flex items on mobile */
  .flex-mobile-column {
    flex-direction: column !important;
  }

  /* Smaller text on mobile */
  .text-mobile-sm {
    font-size: 0.875rem !important;
  }

  /* Remove fixed positioning on mobile */
  .position-mobile-static {
    position: static !important;
  }

  /* Better spacing on mobile */
  .p-mobile-1 { padding: 0.5rem !important; }
  .p-mobile-2 { padding: 1rem !important; }
  .p-mobile-3 { padding: 1.5rem !important; }
  .m-mobile-0 { margin: 0 !important; }
  .m-mobile-1 { margin: 0.5rem !important; }
  .mb-mobile-2 { margin-bottom: 1rem !important; }
  .mt-mobile-2 { margin-top: 1rem !important; }
}

/* ========================================
   SCROLLBAR IMPROVEMENTS (MOBILE)
   ======================================== */

@media (max-width: 767px) {
  /* Thinner scrollbars on webkit browsers */
  ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }

  ::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  ::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
  }
}

/* ========================================
   SAFE AREA INSETS (for notched devices)
   ======================================== */

@supports (padding: max(0px)) {
  @media (max-width: 767px) {
    body {
      padding-left: max(0px, env(safe-area-inset-left));
      padding-right: max(0px, env(safe-area-inset-right));
    }

    /* Fixed elements need safe area consideration */
    .navbar.fixed-top {
      padding-top: max(0.5rem, env(safe-area-inset-top));
    }

    /* Chat input at bottom */
    .chat-input {
      padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
  }
}
