/* ============================================
   BIKE TA BAI - MOBILE FIRST DESIGN
   ============================================ */

/* Mobile-First Base Styles */
:root {
    --mobile-padding: 16px;
    --mobile-margin: 12px;
    --touch-target: 48px;
    --mobile-font-base: 16px;
    --mobile-font-large: 20px;
    --mobile-font-small: 14px;
}

/* ============================================
   MOBILE TYPOGRAPHY
   ============================================ */

body {
    font-size: var(--mobile-font-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, .h1 {
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 16px;
}

h2, .h2 {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 14px;
}

h3, .h3 {
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 12px;
}

h4, .h4 {
    font-size: 18px;
    line-height: 1.4;
}

/* ============================================
   MOBILE CONTAINER & SPACING
   ============================================ */

.container,
.container-fluid {
    padding-left: var(--mobile-padding);
    padding-right: var(--mobile-padding);
}

.mobile-section {
    padding: 20px 0;
}

.mobile-card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 16px;
    overflow: hidden;
}

/* ============================================
   MOBILE BUTTONS (Touch Optimized)
   ============================================ */

.btn,
button,
.btn-mobile {
    min-height: var(--touch-target);
    min-width: var(--touch-target);
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-mobile-full {
    width: 100%;
    display: block;
    text-align: center;
}

.btn-mobile-large {
    min-height: 56px;
    font-size: 18px;
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

/* Success Button Enhancement */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-success:hover {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    transform: translateY(-2px);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

/* Ripple Effect */
.btn-success::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.btn-success:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

.btn:active,
button:active {
    transform: scale(0.98);
}

/* ============================================
   MOBILE FORMS
   ============================================ */

.form-control,
.form-select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"] {
    min-height: 48px;
    font-size: 16px; /* Prevents iOS zoom */
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    touch-action: manipulation;
}

.form-control:focus,
.form-select:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
    outline: none;
    transform: translateY(-2px);
    background: #fff;
}

/* Floating Label Effect */
.form-label {
    transition: all 0.3s ease;
}

.form-control:focus + .form-label {
    color: #28a745;
}

/* Section Headers in Forms */
.mobile-register-card h3 {
    position: relative;
    padding-left: 48px;
    margin-bottom: 20px;
}

.mobile-register-card h3 i {
    position: absolute;
    left: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #e8f5e9, #f0f9f4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

textarea.form-control {
    min-height: 100px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-check-input {
    width: 24px;
    height: 24px;
    margin-top: 0;
    cursor: pointer;
}

.form-check-label {
    font-size: 16px;
    padding-left: 8px;
    cursor: pointer;
}

/* Mobile File Upload */
.mobile-file-upload {
    position: relative;
    display: block;
    width: 100%;
    min-height: 120px;
    border: 2px dashed #28a745;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    text-align: center;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-file-upload:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #20c997;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.mobile-file-upload:active {
    background: #e9ecef;
    transform: translateY(0);
}

.mobile-file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

.mobile-file-upload-icon {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 12px;
}

.mobile-file-upload-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.mobile-file-upload-hint {
    font-size: 13px;
    color: #666;
}

/* ============================================
   MOBILE REGISTRATION PAGE
   ============================================ */

.mobile-register-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #e8f5e9 0%, #e0f2f1 50%, #e1f5fe 100%);
    background-attachment: fixed;
    padding: 20px 16px;
    position: relative;
}

.mobile-register-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    z-index: 0;
}

.mobile-register-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 32px 24px;
    margin-bottom: 80px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
    .mobile-register-card {
        padding: 40px;
    }
}

.mobile-register-header {
    text-align: center;
    margin-bottom: 28px;
}

.mobile-register-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 44px;
    color: white;
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.3);
    animation: iconBounce 1s ease-in-out;
    position: relative;
}

.mobile-register-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745, #20c997);
    animation: pulse 2s infinite;
    z-index: -1;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

.mobile-register-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.mobile-register-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
}

/* Role Selection Cards */
.mobile-role-selector {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.mobile-role-card {
    position: relative;
    border: 3px solid #e0e0e0;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    touch-action: manipulation;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.mobile-role-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #20c997;
}

.mobile-role-card input[type="checkbox"],
.mobile-role-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.mobile-role-card.selected {
    border-color: #28a745;
    background: linear-gradient(135deg, #e8f5e9 0%, #f0f9f4 100%);
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.2);
    transform: translateY(-2px);
}

.mobile-role-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-role-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
}

.mobile-role-card:hover .mobile-role-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.mobile-role-card.selected .mobile-role-icon {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    transform: scale(1.05);
}

.mobile-role-info h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #333;
}

.mobile-role-info p {
    font-size: 13px;
    color: #666;
    margin-bottom: 0;
}

.mobile-role-check {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    font-size: 18px;
}

.mobile-role-card:hover .mobile-role-check {
    border-color: #20c997;
    transform: scale(1.1);
}

.mobile-role-card.selected .mobile-role-check {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #28a745;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.mobile-role-check i {
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-role-card.selected .mobile-role-check i {
    opacity: 1;
    transform: scale(1);
}

/* Mobile Alert Box */
.mobile-alert {
    border-radius: 12px;
    padding: 16px 16px 16px 56px;
    margin-bottom: 20px;
    border-left: 4px solid;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-alert i:first-child {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
}

.mobile-alert-info {
    background: linear-gradient(135deg, #e7f5ff 0%, #d0ebff 100%);
    border-left-color: #0dcaf0;
}

.mobile-alert-success {
    background: linear-gradient(135deg, #d1f0d9 0%, #c1e6ca 100%);
    border-left-color: #28a745;
}

.mobile-alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border-left-color: #ffc107;
}

.mobile-alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
    border-left-color: #dc3545;
}

/* ============================================
   MOBILE NAVIGATION
   ============================================ */

.mobile-nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e8e8e8;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 1000;
    padding: 0.5rem 0;
    display: none; /* Show only on mobile */
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.5rem;
}

.mobile-nav-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.25rem;
    text-decoration: none;
    color: #6a6a6a;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    border-radius: 0.75rem;
    position: relative;
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

.mobile-nav-item.active {
    color: #87A96B;
    background: #E8F0E3;
}

.mobile-nav-item:hover:not(.active) {
    color: #87A96B;
}

.mobile-nav-item i {
    font-size: 1.375rem;
    display: block;
    margin-bottom: 0.25rem;
}

.mobile-nav-item span {
    font-size: 0.6875rem;
    font-weight: 600;
    display: block;
}

/* ============================================
   MOBILE HEADER
   ============================================ */

.mobile-header {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-header-logo {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.mobile-header-actions {
    display: flex;
    gap: 12px;
}

.mobile-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.2s ease;
}

.mobile-icon-btn:active {
    background: rgba(255,255,255,0.3);
}

/* ============================================
   MOBILE CARDS & LISTS
   ============================================ */

.mobile-bike-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 16px;
    touch-action: manipulation;
}

.mobile-bike-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.mobile-bike-content {
    padding: 16px;
}

.mobile-bike-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.mobile-bike-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.mobile-detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
}

.mobile-bike-price {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
}

.mobile-bike-price small {
    font-size: 14px;
    font-weight: normal;
    color: #666;
}

/* ============================================
   MOBILE FILTERS & SEARCH
   ============================================ */

.mobile-search-bar {
    position: sticky;
    top: 0;
    background: white;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 998;
}

.mobile-search-input-group {
    position: relative;
}

.mobile-search-input {
    width: 100%;
    padding: 12px 48px 12px 48px;
    border-radius: 24px;
    border: 2px solid #e0e0e0;
    font-size: 16px;
}

.mobile-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 20px;
}

.mobile-filter-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #28a745;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.mobile-filter-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    z-index: 1001;
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-filter-sheet.open {
    transform: translateY(0);
}

.mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mobile-filter-title {
    font-size: 20px;
    font-weight: 700;
}

.mobile-filter-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* ============================================
   MOBILE BOOKING FORM
   ============================================ */

.mobile-booking-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 16px;
    z-index: 1000;
}

.mobile-booking-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mobile-booking-price {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
}

.mobile-booking-price small {
    font-size: 14px;
    font-weight: normal;
    color: #666;
    display: block;
}

/* ============================================
   MOBILE UTILITIES
   ============================================ */

.mobile-spacer {
    height: 80px; /* Space for bottom nav */
}

.mobile-text-center {
    text-align: center;
}

.mobile-mt-1 { margin-top: 8px; }
.mobile-mt-2 { margin-top: 16px; }
.mobile-mt-3 { margin-top: 24px; }
.mobile-mb-1 { margin-bottom: 8px; }
.mobile-mb-2 { margin-bottom: 16px; }
.mobile-mb-3 { margin-bottom: 24px; }

.mobile-p-1 { padding: 8px; }
.mobile-p-2 { padding: 16px; }
.mobile-p-3 { padding: 24px; }

.mobile-hide {
    display: none !important;
}

.mobile-show {
    display: block !important;
}

/* ============================================
   MOBILE MEDIA QUERIES
   ============================================ */

/* Mobile Only (up to 767px) */
@media (max-width: 767px) {
    .mobile-nav-bottom {
        display: block;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    /* Adjust container */
    .container {
        max-width: 100%;
    }
    
    /* Full width cards on mobile */
    .card {
        border-radius: 12px;
    }
    
    /* Stack columns on mobile */
    .row > [class*="col-"] {
        margin-bottom: 16px;
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .mobile-register-card {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Desktop (992px and up) */
@media (min-width: 992px) {
    .mobile-only {
        display: none !important;
    }
    
    .mobile-register-container {
        padding: 40px 20px;
    }
    
    .mobile-register-card {
        max-width: 600px;
        margin: 0 auto;
        padding: 40px;
    }
}

/* ============================================
   TOUCH INTERACTIONS
   ============================================ */

/* Remove tap highlight */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Improve touch scrolling */
.mobile-scroll-container {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Safe area for notch devices */
@supports (padding: max(0px)) {
    .mobile-header,
    .mobile-nav-bottom {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    
    .mobile-nav-bottom {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Prevent zoom on double tap */
button,
a,
input[type="submit"],
input[type="button"] {
    touch-action: manipulation;
}

/* ============================================
   MOBILE ANIMATIONS
   ============================================ */

.mobile-fade-in {
    animation: mobileFadeIn 0.3s ease;
}

@keyframes mobileFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-slide-up {
    animation: mobileSlideUp 0.3s ease;
}

@keyframes mobileSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

