/* Chappita - Global Styles */

/* Remixicon fix */
:where([class^="ri-"])::before {
    content: "\f3c2";
}

/* Custom button border radius utility */
.!rounded-button {
    border-radius: 8px !important;
}

/* Mobile-first responsive layout */
html {
    background-color: #e5e7eb; /* Gray background for desktop */
    display: flex;
    justify-content: center;
}

body {
    max-width: 375px;
    width: 100%;
    min-height: 100vh;
    background-color: #fafafa;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); /* Subtle shadow for desktop */
    overflow-x: hidden;
}

/* Constrain fixed elements to mobile width and center them */
nav.fixed,
.fixed.top-0,
.fixed.bottom-0 {
    max-width: 375px;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
}

/* Constrain floating buttons to mobile width */
button.fixed {
    left: auto !important;
    right: calc(50% - 375px/2 + 1rem) !important;
}

@media (max-width: 375px) {
    nav.fixed,
    .fixed.top-0,
    .fixed.bottom-0 {
        left: 0 !important;
        transform: none !important;
    }
    
    button.fixed {
        right: 1rem !important;
    }
}

/* Toggle Switch Styles */
.switch-container {
    position: relative;
    width: 44px;
    height: 24px;
}

.switch-input {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.switch-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 12px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.switch-input:checked + .switch-slider {
    background-color: #2563eb;
}

.switch-input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* Button Hover Effects */
button:not(.switch-input):hover,
a[role="button"]:hover {
    transform: translateY(-1px);
}

button:not(.switch-input):active,
a[role="button"]:active {
    transform: translateY(0);
}

/* Card Hover Effects */
.bg-white.rounded-xl:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Smooth Modal Animations */
.fixed.inset-0 {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fixed.inset-0 > div {
    animation: slideUp 0.3s ease;
}

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

/* Loading Skeleton */
.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;
    }
}

/* Pulse Animation for Notifications */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Image Fallback Placeholder */
img[src=""],
img:not([src]),
img[src*="placeholder"] {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    position: relative;
}

img[src=""]::before,
img:not([src])::before,
img[src*="placeholder"]::before {
    content: "📷";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.3;
}

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

/* Focus States for Accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Disabled State */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Ripple Effect */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    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%);
    animation: ripple 0.6s ease-out;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Toast Notification Animation */
@keyframes slideInUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.toast {
    animation: slideInUp 0.3s ease;
}

/* Success/Error States */
.success {
    background-color: #10b981;
    color: white;
}

.error {
    background-color: #ef4444;
    color: white;
}

.warning {
    background-color: #f59e0b;
    color: white;
}

.info {
    background-color: #3b82f6;
    color: white;
}

/* Shimmer Effect for Loading */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* Location Suggestions Positioning */
.location-suggestions {
    max-height: 200px;
    overflow-y: auto;
}
