/* Custom CSS for Laundry Made Easy Mobile App */

/* Root Variables */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: var(--gray-900);
    background-color: var(--gray-50);
    overscroll-behavior: contain;
}

/* Prevent pull-to-refresh on iOS */
body {
    position: fixed;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Page Transitions */
.page {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Bottom Navigation Styles */
nav .nav-item {
    color: var(--gray-500);
    transition: all 0.2s ease;
}

nav .nav-item.active {
    color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

nav .nav-item:active {
    transform: scale(0.95);
}

/* Card Styles */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Button Styles */
button {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Styles */
input, select, textarea {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Order Status Colors */
.status-pending { background-color: var(--gray-100); color: var(--gray-700); }
.status-processing { background-color: #fef3c7; color: #92400e; }
.status-ready { background-color: #d1fae5; color: #065f46; }
.status-delivered { background-color: var(--gray-100); color: var(--gray-600); }

/* Service Icons */
.service-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.service-icon:hover {
    transform: scale(1.05);
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-800);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    z-index: 200;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Pull to Refresh */
.pull-to-refresh {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pull-to-refresh.active {
    top: 20px;
}

/* Swipe Actions */
.swipeable {
    position: relative;
    overflow: hidden;
}

.swipe-action {
    position: absolute;
    top: 0;
    right: -80px;
    bottom: 0;
    width: 80px;
    background: var(--danger-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: right 0.3s ease;
}

.swipeable.swiped .swipe-action {
    right: 0;
}

/* iOS Specific Styles */
@supports (padding: env(safe-area-inset-top)) {
    .safe-top {
        padding-top: env(safe-area-inset-top);
    }
    
    .safe-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .safe-left {
        padding-left: env(safe-area-inset-left);
    }
    
    .safe-right {
        padding-right: env(safe-area-inset-right);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #1f2937;
        --gray-100: #374151;
        --gray-900: #f9fafb;
    }
    
    body {
        background-color: #111827;
        color: #f9fafb;
    }
    
    .card {
        background: #1f2937;
    }
    
    input, select, textarea {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }
}

/* Responsive Design */
@media (min-width: 768px) {
    #app {
        max-width: 428px;
        margin: 0 auto;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    }
}

/* Print Styles */
@media print {
    nav, header {
        display: none;
    }
    
    main {
        padding: 0;
    }
}