/**
 * Global Mobile Optimizations
 * Additional CSS for mobile-friendly improvements across the platform
 */

/* Ensure all images are responsive by default */
img {
    max-width: 100%;
    height: auto;
}

/* Touch-friendly buttons - minimum 44x44px */
button, 
a.button,
input[type="submit"],
input[type="button"] {
    min-height: 44px;
    min-width: 44px;
}

/* Better touch targets for small buttons */
.btn-small {
    min-height: 44px;
    padding: 12px 16px;
}

/* Full-width inputs on mobile */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    textarea,
    select {
        width: 100% !important;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Stack form elements on mobile */
    .form-row {
        flex-direction: column;
    }
    
    /* Full-width buttons on mobile */
    .btn-primary,
    .btn-submit {
        width: 100%;
    }
}

/* Better spacing for touch interactions */
@media (max-width: 767px) {
    .space-y-2 > * + * {
        margin-top: 1rem;
    }
    
    .space-y-4 > * + * {
        margin-top: 1.5rem;
    }
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* Better table handling on mobile */
@media (max-width: 767px) {
    table {
        font-size: 14px;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Improve readability on mobile */
@media (max-width: 767px) {
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
}

/* Better checkbox/radio touch targets */
input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
}

/* Touch-friendly labels */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 14px;
    font-weight: 500;
}

/* Better focus states for accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ============================================
   STANDARD BUTTON CLASS
   ============================================ */

/* Reusable button class to replace long Tailwind class strings */
/* Matches: w-full sm:w-auto px-8 py-3 bg-gray-900 text-white rounded-2xl font-semibold hover:bg-gray-800 transition transform hover:scale-105 text-center min-h-[44px] flex items-center justify-center */
.btn-standard {
    /* w-full */
    width: 100%;
    /* px-8 py-3 */
    padding: 0.75rem 2rem; /* 12px 32px */
    /* bg-gray-900 */
    background-color: #111827;
    /* text-white */
    color: #ffffff;
    /* rounded-2xl */
    border-radius: 1rem; /* 16px */
    /* font-semibold */
    font-weight: 600;
    /* text-center */
    text-align: center;
    /* min-h-[44px] */
    min-height: 44px;
    /* flex items-center justify-center */
    display: flex;
    align-items: center;
    justify-content: center;
    /* transition */
    transition-property: background-color, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
    /* transform */
    transform: scale(1);
}

.btn-standard:hover {
    /* hover:bg-gray-800 */
    background-color: #1f2937;
    /* hover:scale-105 */
    transform: scale(1.05);
}

/* Responsive: sm:w-auto (640px+) */
@media (min-width: 640px) {
    .btn-standard {
        width: auto;
    }
}

/* Secondary/white button variant */
/* Matches: w-full sm:w-auto px-8 py-3 bg-white text-gray-900 rounded-2xl font-semibold hover:bg-gray-100 transition transform hover:scale-105 text-center min-h-[44px] flex items-center justify-center */
.btn-standard-secondary {
    /* w-full */
    width: 100%;
    /* px-8 py-3 */
    padding: 0.75rem 2rem; /* 12px 32px */
    /* bg-white */
    background-color: #ffffff;
    /* text-gray-900 */
    color: #111827;
    /* rounded-2xl */
    border-radius: 1rem; /* 16px */
    /* font-semibold */
    font-weight: 600;
    /* text-center */
    text-align: center;
    /* min-h-[44px] */
    min-height: 44px;
    /* flex items-center justify-center */
    display: flex;
    align-items: center;
    justify-content: center;
    /* transition */
    transition-property: background-color, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
    /* transform */
    transform: scale(1);
}

.btn-standard-secondary:hover {
    /* hover:bg-gray-100 */
    background-color: #f3f4f6;
    /* hover:scale-105 */
    transform: scale(1.05);
}

/* Responsive: sm:w-auto (640px+) */
@media (min-width: 640px) {
    .btn-standard-secondary {
        width: auto;
    }
}

/* Prevent text size adjustment on iOS */
@media (max-width: 767px) {
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

