/* Mobile-First Responsive Design for SellSite */

/* Base mobile optimizations */
* {
    -webkit-tap-highlight-color: rgba(139, 92, 246, 0.3);
    touch-action: manipulation;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Prevent zoom on input focus (iOS) */
input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="number"], 
input[type="tel"], 
input[type="url"], 
textarea, 
select {
    font-size: 16px;
    -webkit-appearance: none;
    border-radius: 8px;
}

/* Touch-friendly buttons */
button, 
.btn, 
.button {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 1rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

.mobile-nav-toggle {
    background: rgba(139, 92, 246, 0.9);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive grid systems */
.responsive-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.responsive-grid-2 {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.responsive-grid-3 {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.responsive-grid-4 {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

/* Card optimizations */
.card {
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
}

/* Form optimizations */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e2e8f0;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Table optimizations */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    white-space: nowrap;
}

/* Modal optimizations */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Loading states */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.3);
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(15, 15, 35, 0.95);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #8b5cf6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

/* Responsive breakpoints */
@media (min-width: 480px) {
    .responsive-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .responsive-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .responsive-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
    
    .responsive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .responsive-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .responsive-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .responsive-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .table th,
    .table td {
        padding: 1rem;
        font-size: 16px;
    }
}

@media (min-width: 1024px) {
    .responsive-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .responsive-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .responsive-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile-specific utilities */
.mobile-only {
    display: block;
}

.desktop-only {
    display: none;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none;
    }
    
    .desktop-only {
        display: block;
    }
}

/* Touch gestures */
.swipe-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.swipe-item {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #ffffff;
    }
    
    .form-input {
        border: 2px solid #ffffff;
    }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    .card {
        background: rgba(0, 0, 0, 0.3);
    }
    
    .form-input {
        background: rgba(0, 0, 0, 0.3);
    }
}

