/* Mobile Cover Designer Styles */

/* Base styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Page transitions */
.page {
    transition: all 0.3s ease-in-out;
}

.page.hidden {
    display: none;
}

/* Card hover effects */
.case-type-card:hover,
.brand-card:hover,
.model-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Canvas container */
.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    /* Remove fixed min-height to avoid stretching on mobile */
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%),
        linear-gradient(-45deg, #f8f9fa 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f8f9fa 75%),
        linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Canvas styling */
#designCanvas {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: white;
    max-width: 100%;
    height: auto !important;
    /* Prevent CSS from stretching height on mobile */
}

/* Ensure touch gestures reach the canvas */
#designCanvas {
    touch-action: none;
}

/* Modal styling */
.modal {
    backdrop-filter: blur(4px);
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Form controls */
input[type="file"] {
    border: 2px dashed #d1d5db;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
}

/* Range slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #d1d5db;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #4b5563;
    transform: scale(1.1);
}

/* Color picker */
input[type="color"] {
    border: 2px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="color"]:hover {
    border-color: #9ca3af;
    transform: scale(1.05);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #6b7280;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .canvas-container {
        padding: 8px;
    }

    #designCanvas {
        max-width: 100%;
        height: auto !important;
    }

    .case-type-card,
    .brand-card,
    .model-card {
        padding: 1rem;
    }

    .grid {
        gap: 1rem;
    }
}

/* Touch gestures for mobile */
@media (hover: none) and (pointer: coarse) {

    .case-type-card:active,
    .brand-card:active,
    .model-card:active {
        transform: scale(0.98);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Success/Error states */
.success {
    color: #059669;
    background-color: #d1fae5;
    border-color: #a7f3d0;
}

.error {
    color: #dc2626;
    background-color: #fee2e2;
    border-color: #fca5a5;
}

/* Animation for page transitions */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.page-enter {
    animation: slideInRight 0.3s ease-out;
}

.page-exit {
    animation: slideInLeft 0.3s ease-out;
}