/* ============================================
   MARBLETECH MOBILE-OPTIMIZED STYLES
   Link this file AFTER your main styles
   ============================================ */

/* Base Mobile Resets */
@media (max-width: 768px) {
  * {
    -webkit-tap-highlight-color: transparent;
  }

  body {
    font-size: 14px;
    padding-top: 0 !important;
  }

  /* ============================================
     MOBILE NAVIGATION
     ============================================ */
  .navbar {
    padding: 0.75rem 0;
    position: fixed;
    top: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  .nav-container {
    padding: 0 1rem;
    flex-wrap: wrap;
  }

  .logo {
    font-size: 1.2rem;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .nav-links {
    display: none !important;
  }

  .nav-auth {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 0.5rem;
  }

  .nav-auth button {
    flex: 1;
    min-width: 80px;
    font-size: 0.85rem;
    padding: 6px 12px !important;
  }

  .nav-auth button i {
    display: none;
  }

  /* ============================================
     BANNERS (Trial, Subscription, Renewal)
     ============================================ */
  .trial-banner,
  .subscription-banner,
  .renewal-banner {
    padding: 12px 10px;
    font-size: 0.85rem;
    position: relative;
    top: 0;
  }

  .trial-timer {
    display: block;
    margin: 8px 0 0 0;
    font-size: 0.8rem;
    padding: 4px 10px;
  }

  .renewal-banner > div {
    flex-direction: column !important;
    gap: 10px;
    padding: 0 10px !important;
  }

  .renewal-banner button {
    width: 100%;
    font-size: 0.85rem;
  }

  /* ============================================
     HERO SECTION
     ============================================ */
  .hero {
    min-height: 100vh;
    padding: 80px 20px 40px;
  }

  .hero-content {
    padding: 0 15px;
  }

  .hero h1 {
    font-size: 1.8rem !important;
    line-height: 1.3;
    margin-bottom: 1rem;
  }

  .hero p {
    font-size: 1rem !important;
    line-height: 1.5;
    margin-bottom: 1.5rem;
  }

  .cta-buttons {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    justify-content: center;
  }

  /* ============================================
     FEATURES SECTION
     ============================================ */
  .features {
    padding: 60px 0;
  }

  .section-title h2 {
    font-size: 1.75rem !important;
    line-height: 1.3;
  }

  .section-title p {
    font-size: 1rem;
    padding: 0 15px;
  }

  .features-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    padding: 0 15px;
  }

  .feature-card {
    padding: 1.5rem;
    border-radius: 15px;
  }

  .feature-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .feature-card h3 {
    font-size: 1.25rem;
  }

  .feature-card p {
    font-size: 0.95rem;
  }

  /* ============================================
     PRICING SECTION
     ============================================ */
  .pricing {
    padding: 60px 0;
  }

  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    padding: 0 15px;
  }

  .pricing-card {
    padding: 2rem 1.5rem;
    border-radius: 15px;
  }

  .pricing-card.featured {
    transform: none !important;
    margin-bottom: 0;
  }

  .pricing-card.featured::before {
    font-size: 0.8rem;
    padding: 6px 15px;
  }

  .pricing-card h3 {
    font-size: 1.3rem;
  }

  .pricing-card .price {
    font-size: 2.5rem !important;
  }

  .pricing-features {
    text-align: left;
    font-size: 0.9rem;
  }

  .pricing-features li {
    padding: 0.4rem 0;
  }

  /* ============================================
     CONTACT SECTION
     ============================================ */
  .contact-section {
    padding: 60px 0;
  }

  .contact-container {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    padding: 0 15px;
  }

  .contact-info,
  .contact-form {
    padding: 1.5rem;
    border-radius: 15px;
  }

  .contact-info h3,
  .contact-form h3 {
    font-size: 1.3rem;
  }

  .form-row {
    grid-template-columns: 1fr !important;
  }

  .contact-details li {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
  }

  .contact-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    margin-bottom: 8px;
  }

  /* ============================================
     ABOUT SECTION
     ============================================ */
  .about-section {
    padding: 60px 0;
  }

  .stats-showcase {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem;
    margin: 2rem 0;
  }

  .stat-item {
    padding: 1.5rem 1rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .stat-item p {
    font-size: 0.9rem;
  }

  .testimonials-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    padding: 0 15px;
  }

  .testimonial-card {
    padding: 1.5rem;
  }

  /* ============================================
     INFO SECTIONS (Privacy, Terms, Support)
     ============================================ */
  .info-section {
    padding: 60px 0;
  }

  .info-content {
    padding: 1.5rem !important;
    border-radius: 15px;
  }

  .info-content h2 {
    font-size: 1.6rem;
  }

  .info-content h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
  }

  .info-content p,
  .info-content li {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  /* ============================================
     FOOTER
     ============================================ */
  .footer {
    padding: 2rem 0;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .footer-links a {
    font-size: 0.95rem;
  }

  /* ============================================
     MODALS
     ============================================ */
  .modal-content {
    width: 95% !important;
    max-width: 100% !important;
    padding: 1.5rem;
    border-radius: 15px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-header h2 {
    font-size: 1.5rem;
  }

  .modal-header p {
    font-size: 0.9rem;
  }

  .close-modal {
    font-size: 1.8rem;
    top: 10px;
    right: 15px;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 1rem;
    padding: 12px;
  }

  .btn-full {
    padding: 14px;
    font-size: 1rem;
  }

  .auth-switch {
    font-size: 0.9rem;
  }

  /* Admin Modal */
  .admin-indicator {
    font-size: 0.65rem;
    padding: 3px 6px;
  }

  /* ============================================
     ACCOUNT MODAL
     ============================================ */
  #accountModal .modal-content {
    max-height: 95vh;
  }

  .account-info-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .account-info-grid div {
    font-size: 0.9rem;
  }

  #userInfoSection,
  #currentSubscriptionSection,
  #featuresAccessSection {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
  }

  #currentSubscriptionSection h3,
  #featuresAccessSection h3,
  #userInfoSection h3 {
    font-size: 1.1rem;
  }

  #currentPlanDisplay {
    font-size: 1.3rem !important;
  }

  #subscriptionStatusDisplay,
  #subscriptionExpiryDisplay {
    font-size: 0.9rem;
  }

  .subscription-details {
    flex-direction: column;
    align-items: stretch !important;
  }

  #upgradeButton,
  #renewButton {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
    padding: 12px 20px;
    font-size: 0.95rem;
  }

  #planFeaturesList li {
    font-size: 0.9rem;
    padding: 8px 0;
  }

  /* Countdown Timer */
  #subscriptionCountdown {
    padding: 10px;
    margin-top: 10px;
  }

  #countdownTimer {
    font-size: 1.1rem !important;
  }

  #countdownTimer span {
    min-width: 20px;
  }

  #nextRenewalInfo {
    font-size: 0.85rem !important;
    padding: 8px;
  }

  /* ============================================
     UPGRADE MODAL
     ============================================ */
  #upgradeModal .modal-content,
  #renewalModal .modal-content,
  #subscriptionModal .modal-content {
    max-width: 95% !important;
  }

  #currentPlanInfo,
  #currentPlanInfo2 {
    padding: 12px;
    font-size: 0.9rem;
    margin-bottom: 15px;
  }

  #upgradeOptionsContainer {
    grid-template-columns: 1fr !important;
    gap: 15px;
  }

  /* Subscription/Renewal Pricing Cards in Modal */
  #subscriptionModal .pricing-grid,
  #renewalModal .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    padding: 0;
  }

  #subscriptionModal .pricing-card,
  #renewalModal .pricing-card,
  #upgradeOptionsContainer .pricing-card {
    padding: 1.5rem;
    margin-bottom: 0;
  }

  #subscriptionModal .pricing-card h3,
  #renewalModal .pricing-card h3 {
    font-size: 1.2rem;
  }

  #subscriptionModal .pricing-card .price,
  #renewalModal .pricing-card .price {
    font-size: 2rem !important;
  }

  #subscriptionModal .pricing-card ul,
  #renewalModal .pricing-card ul {
    font-size: 0.85rem;
    padding-left: 1rem;
  }

  /* ============================================
     POST-REGISTER MODAL
     ============================================ */
  #postRegisterModal .modal-content {
    padding: 2rem 1.5rem;
  }

  #postRegisterModal > div {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  #postRegisterModal button {
    width: 100%;
  }

  /* ============================================
     LOADING STATES
     ============================================ */
  .loading {
    font-size: 0.9rem;
  }

  .spinner {
    width: 25px;
    height: 25px;
  }

  /* ============================================
     BUTTONS & INTERACTIONS
     ============================================ */
  .btn-sm {
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
  }

  .btn:hover {
    transform: none;
  }

  .feature-card:hover,
  .pricing-card:hover,
  .testimonial-card:hover {
    transform: none;
  }

  /* ============================================
     UTILITY CLASSES
     ============================================ */
  .container {
    padding: 0 15px;
  }

  /* Remove hover effects on mobile */
  a:hover,
  button:hover {
    transform: none !important;
  }

  /* Better touch targets */
  button,
  a,
  input,
  select,
  textarea {
    min-height: 44px;
  }

  /* ============================================
     SCROLLBAR (optional - webkit only)
     ============================================ */
  ::-webkit-scrollbar {
    width: 6px;
  }

  ::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  ::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
  }

  /* ============================================
     SAFE AREA PADDING (for notched devices)
     ============================================ */
  .navbar {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .hero,
  .features,
  .pricing,
  .contact-section,
  .about-section,
  .info-section {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  /* ============================================
     ORIENTATION ADJUSTMENTS
     ============================================ */
  @media (orientation: landscape) and (max-height: 500px) {
    .hero {
      min-height: auto;
      padding: 60px 20px 40px;
    }

    .hero h1 {
      font-size: 1.5rem !important;
    }

    .modal-content {
      max-height: 95vh;
    }
  }
}

/* ============================================
   SMALL MOBILE DEVICES (< 400px)
   ============================================ */
@media (max-width: 400px) {
  .hero h1 {
    font-size: 1.6rem !important;
  }

  .section-title h2 {
    font-size: 1.5rem !important;
  }

  .pricing-card .price {
    font-size: 2rem !important;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .nav-auth button {
    font-size: 0.8rem;
    padding: 5px 10px !important;
  }
}

/* ============================================
   TOUCH-SPECIFIC IMPROVEMENTS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  /* Remove all hover effects for touch devices */
  .btn:hover,
  .feature-card:hover,
  .pricing-card:hover,
  .nav-links a:hover,
  .footer-links a:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  /* Add active state for better touch feedback */
  .btn:active {
    transform: scale(0.98);
    opacity: 0.9;
  }

  .feature-card:active,
  .pricing-card:active {
    opacity: 0.95;
  }
}

/* ============================================
   PRINT STYLES (bonus)
   ============================================ */
@media print {
  .navbar,
  .footer,
  .trial-banner,
  .subscription-banner,
  .renewal-banner,
  .cta-buttons,
  .nav-auth,
  .modal {
    display: none !important;
  }

  body {
    padding-top: 0 !important;
  }
}