/* Custom CSS for Murshad Restaurant */

/* Font Family */
body {
    font-family: 'Cabinet Grotesk', sans-serif;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Hide scrollbar for Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Button hover effects */
.btn-hover {
    transition: all 0.3s ease;
}

.btn-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Navbar scroll effect */
nav.navbar-scrolled {
    background-color: white !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#navbar.navbar-scrolled {
    background-color: white !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Navbar text colors when scrolled */

.navbar-scrolled .nav-link {
    color: #374151 !important; /* gray-700 */
}

.navbar-scrolled .nav-link:hover {
    color: #067855 !important; /* primary-green */
}

.navbar-scrolled .nav-current {
    color: #067855 !important; /* primary-green */
}

.navbar-scrolled .nav-icon {
    color: #374151 !important; /* gray-700 */
}

.navbar-scrolled .nav-icon:hover {
    color: #067855 !important; /* primary-green */
}

/* Hero section background pattern */
.hero-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

/* Authentication Modal Styles */
#authModal {
    backdrop-filter: blur(4px);
    transition: all 0.3s ease-in-out;
}

#authModal.flex {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal content animation */
#authModal .bg-white {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Form transition animations */
.form-transition {
    transition: all 0.3s ease-in-out;
}

/* Signup step animations */
.signup-step-content {
    transition: all 0.3s ease-in-out;
    position: absolute;
    width: 100%;
}

.signup-step-content.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
}

.signup-step-content:not(.active) {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

/* Progress step indicators */
.signup-step .w-8 {
    transition: all 0.3s ease-in-out;
}

.signup-step.active .w-8 {
    background-color: #067855; /* primary-green */
    color: white;
}

.signup-step:not(.active) .w-8 {
    background-color: #e5e7eb; /* gray-200 */
    color: #6b7280; /* gray-500 */
}

/* Progress bar animation */
.signup-step .h-1 .bg-primary-green {
    transition: width 0.3s ease-in-out;
}

/* Input focus animations */
input:focus, select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 120, 85, 0.15);
}

/* Button hover animations */
button[type="submit"], #nextStep, #submitSignup {
    position: relative;
    overflow: hidden;
}

button[type="submit"]:hover, #nextStep:hover, #submitSignup:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 120, 85, 0.3);
}

/* Shimmer effect for buttons */
button[type="submit"]::before, #nextStep::before, #submitSignup::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

button[type="submit"]:hover::before, #nextStep:hover::before, #submitSignup:hover::before {
    left: 100%;
}

/* Validation error styles */
.validation-error {
    animation: errorSlideIn 0.3s ease-out;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive modal adjustments */
@media (max-width: 768px) {
    #authModal .bg-white {
        margin: 1rem;
        min-height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    #authModal .hidden.md\\:block {
        display: none !important;
    }
    
    #authModal .w-full.md\\:w-7\\/12 {
        width: 100% !important;
    }
    
    .signup-step-content {
        max-height: 50vh;
        overflow-y: auto;
    }
}

/* Custom scrollbar for modal content */
#authModal ::-webkit-scrollbar {
    width: 6px;
}

#authModal ::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#authModal ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#authModal ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Tab underline animation */
#loginTab::after, #signupTab::after {
    transition: transform 0.3s ease-in-out;
}

/* Focus styles for accessibility */
select:focus {
    outline: 2px solid #067855;
    outline-offset: 2px;
}

/* Remove focus outline from buttons and inputs */
button:focus, input:focus {
    outline: none;
}

/* Loading state for forms */
.form-loading {
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #067855;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* User Dropdown Styles */
#userDropdownMenu {
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User dropdown menu items */
#userDropdownMenu a,
#userDropdownMenu button {
    transition: all 0.2s ease;
    padding-left: 12px;
    padding-right: 12px;
}

#userDropdownMenu a:hover,
#userDropdownMenu button:hover {
    background-color: #f3f4f6;
    transform: none;
}

/* User dropdown menu responsive adjustments */
@media (max-width: 768px) {
    #userDropdownMenu {
        right: -1rem;
        width: 200px;
    }
    
    #userName {
        display: none !important;
    }
}

/* Settings Page Styles */
.settings-tab {
    transition: all 0.2s ease;
}

.settings-content {
    animation: fadeInUp 0.3s ease-out;
}

/* Settings form styles */
.settings-form input:focus,
.settings-form select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 120, 85, 0.15);
}

/* Settings button hover effects */
.settings-form button[type="submit"] {
    position: relative;
    overflow: hidden;
}

.settings-form button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 120, 85, 0.3);
}

/* Settings form loading state */
.settings-form .loading {
    pointer-events: none;
    opacity: 0.7;
}

.settings-form .loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #067855;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Settings responsive adjustments */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-navigation {
        order: 2;
    }
    
    .settings-content {
        order: 1;
    }
}

/* Delete Account Modal Styles */
#deleteAccountModal {
    animation: modalFadeIn 0.3s ease-out;
}

#deleteAccountModal .bg-white {
    animation: modalSlideIn 0.3s ease-out;
}

/* Delete modal warning styles */
#deleteAccountModal .bg-red-50 {
    animation: fadeInUp 0.4s ease-out;
}

/* Delete modal button styles */
#confirmDeleteBtn {
    position: relative;
    overflow: hidden;
}

#confirmDeleteBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Delete modal responsive adjustments */
@media (max-width: 768px) {
    #deleteAccountModal .bg-white {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
}

/* Modal background images carousel */
.modal-bg-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 1s ease-in-out;
}

.modal-bg-image.carousel-image {
    opacity: 0;
}

.modal-bg-image.carousel-image.active {
    opacity: 1;
}

/* Carousel container */
.modal-carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.modal-carousel-container .carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.modal-carousel-container .carousel-image.active {
    opacity: 1;
}

/* Cart Drawer Styles */
#cartOverlay {
    backdrop-filter: blur(4px);
    transition: all 0.3s ease-in-out;
}

#cartDrawer {
    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.1);
}

/* Cart drawer animations */
#cartOverlay:not(.hidden) {
    animation: cartOverlayFadeIn 0.3s ease-out;
}

#cartDrawer:not(.translate-x-full) {
    animation: cartDrawerSlideIn 0.3s ease-out;
}

@keyframes cartOverlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes cartDrawerSlideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Cart item animations */
.cart-item-enter {
    animation: cartItemSlideIn 0.3s ease-out;
}

@keyframes cartItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Cart badge animation */
#cartBadge {
    transition: all 0.2s ease-in-out;
}

#cartBadge:not(.hidden) {
    animation: cartBadgeBounce 0.3s ease-out;
}

@keyframes cartBadgeBounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Cart drawer responsive adjustments */
@media (max-width: 768px) {
    #cartDrawer {
        max-width: 100%;
        width: 100%;
    }
    
    #cartDrawer .p-6 {
        padding: 1rem;
    }
    
    #cartDrawer .space-x-4 {
        gap: 0.75rem;
    }
    
    #cartDrawer .w-16 {
        width: 3rem;
        height: 3rem;
    }
}

/* Cart drawer scrollbar styling */
#cartItems::-webkit-scrollbar {
    width: 6px;
}

#cartItems::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#cartItems::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#cartItems::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Cart button hover effects */
#checkoutBtn {
    position: relative;
    overflow: hidden;
}

#checkoutBtn:hover {
    background-color: #a30418 !important; /* primary-red */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(163, 4, 24, 0.3);
}

#continueShoppingBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(163, 4, 24, 0.3);
}

/* Add to Cart button hover effects */
button[onclick*="addItemToCart"]:hover {
    background-color: #a30418 !important; /* primary-red */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(163, 4, 24, 0.3);
}

/* Cart quantity button styles */
#cartItemsList button {
    transition: all 0.2s ease;
}

#cartItemsList button:hover {
    transform: scale(1.1);
}

/* Cart empty state animation */
#emptyCart {
    animation: fadeInUp 0.6s ease-out;
}

/* Cart footer animation */
#cartFooter:not(.hidden) {
    animation: cartFooterSlideUp 0.3s ease-out;
}

@keyframes cartFooterSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Favorites Button Styles */
.favorite-btn {
    position: relative;
    overflow: hidden;
}

.favorite-btn.favorited {
    background-color: rgba(239, 68, 68, 0.3) !important;
}

.favorite-btn.favorited i {
    color: #ef4444 !important; /* red-500 */
}

.favorite-btn.loading {
    pointer-events: none;
}

/* Heart bounce animation */
@keyframes heart-bounce {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.hover\\:animate-heart-bounce:hover {
    animation: heart-bounce 0.6s ease-in-out;
}

/* Mobile menu styles */
@media (max-width: 768px) {
    /* Navbar background when mobile menu is open */
    #navbar.mobile-menu-open {
        background-color: white !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    /* Change logo to black when mobile menu is open */
    #navbar.mobile-menu-open .logo img {
        content: url('/static/images/logo black.PNG');
    }
    
    /* Change text colors when mobile menu is open */
    #navbar.mobile-menu-open .nav-icon {
        color: #374151 !important; /* gray-700 */
    }
    
    #navbar.mobile-menu-open .nav-icon:hover {
        color: #067855 !important; /* primary-green */
    }
    
    /* Mobile menu content styling */
    #mobile-menu {
        background-color: white;
        border-top: 1px solid #e5e7eb;
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    #mobile-menu a {
        color: #374151 !important; /* gray-700 */
        padding: 0.75rem 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    #mobile-menu a:hover {
        color: #067855 !important; /* primary-green */
        background-color: #f9fafb;
        padding-left: 0.5rem;
        transition: all 0.2s ease;
    }
    
    #mobile-menu a:last-child {
        border-bottom: none;
    }
}

/* Favorites button responsive adjustments */
@media (max-width: 768px) {
    .favorite-btn {
        width: 2.5rem;
        height: 2.5rem;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .favorite-btn i {
        font-size: 1.25rem;
    }
}
