/* Carenest Custom Styles */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Root variables inherited from Tailwind's config */
:root {
    --primary-50: #f8fafc;
    --primary-100: #eef1f6;
    --primary-200: #e4e7ed;
    --primary-300: #d7dce4;
    --primary-400: #c2c8d2;
    --primary-500: #92a1b0;
    --primary-600: #75879a;
    --primary-700: #647484;
    --primary-800: #4c5c7c;
    --primary-900: #3c4c64;

    --secondary-50: #fafbfd;
    --secondary-100: #f3f6f9;
    --secondary-200: #e7eaef;
    --secondary-300: #d5d9e0;
    --secondary-400: #b8c0cc;
    --secondary-500: #919ba9;
    --secondary-600: #6b798b;
    --secondary-700: #4c5c74;
    --secondary-800: #2c3c5c;
    --secondary-900: #1c3454;
}

/* Global Styles for body to handle scrollbars */
html,
body {
    overflow-x: hidden;
}

body {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Modal backdrop styling */
[modal-backdrop] {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Spinner animation for loading states */
@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spinner 1s linear infinite;
}

/* Enhanced focus styles for accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Custom styles for carousel card containers */
.offers-card-container,
.most-booked-card-container,
.service-card-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hide scrollbar for all carousels */
.offers-card-container::-webkit-scrollbar,
.most-booked-card-container::-webkit-scrollbar,
.service-card-container::-webkit-scrollbar {
    display: none;
}

/* Hide the scrollbar specifically for the main content area */
#main-scrollable-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#main-scrollable-content::-webkit-scrollbar {
    display: none;
}

/* Responsive card widths for carousels */
.offers-card-item {
    flex-shrink: 0;
    min-width: 300px;
    width: calc((100% - 3rem) / 3);
    /* 3 cards per row, with gaps on larger screens */
    scroll-snap-align: start;
}

@media (max-width: 768px) {
    .offers-card-item {
        width: 100%;
        min-width: 90%;
    }
}

.most-booked-card,
.service-card {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    min-width: 250px;
    width: calc((100% - 3rem) / 5);
    /* 5 cards per row, with gaps */
    scroll-snap-align: start;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

@media (max-width: 1024px) {
    .most-booked-card,
    .service-card {
        width: calc((100% - 1.5rem) / 3);
        /* 3 cards per row on tablets */
    }
}

@media (max-width: 768px) {
    .most-booked-card,
    .service-card {
        width: calc((100% - 0.75rem) / 2);
        /* 2 cards per row on mobile */
    }
}

/* Custom add button for products */
.add-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary-400);
    color: var(--primary-500);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

/* Carousel control buttons */
.carousel-control-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: white;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.carousel-control-btn:hover {
    background-color: var(--primary-50);
}

.carousel-control-btn.left-0 {
    left: 0;
    margin-left: -1.25rem;
}

.carousel-control-btn.right-0 {
    right: 0;
    margin-right: -1.25rem;
}

/* Footer specific styles */
.footer a {
    color: var(--primary-300);
}

.footer a:hover {
    color: white;
}

/* Product Page Specific Styles */
.service-option-card {
    background-color: #fff;
    border: 1px solid var(--primary-200);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.service-option-image-container {
    position: relative;
    width: 150px;
    height: 100px;
    flex-shrink: 0;
}

.service-option-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

.add-button-product-page {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background-color: white;
    color: var(--secondary-700);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    font-weight: 600;
}

.review-card {
    background-color: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: 0.5rem;
    padding: 1rem;
}

/* Utility class for hiding scrollbars on elements */
.no-scrollbar {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* OTP Input Styles */
.otp-input {
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.otp-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(146, 161, 176, 0.2);
    border-color: var(--primary-500);
}

/* OTP Step Animation */
#otpStep {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* New checkout layout styles */
.right-panel-scrollable {
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.right-panel-scrollable::-webkit-scrollbar {
    display: none;
}

.checkout-page main {
    min-height: calc(100vh - 8rem);
    /* Adjust based on header height */
}

/* New styles for tip selection buttons */
.tip-option {
    background-color: white;
    border: 1px solid var(--primary-200);
    color: var(--secondary-700);
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.tip-option.selected {
    background-color: var(--secondary-600);
    color: white;
    border-color: var(--secondary-600);
}

.tip-option:hover {
    background-color: var(--primary-100);
    color: var(--secondary-800);
    border-color: var(--secondary-300);
}