@tailwind base;
@tailwind components;
@tailwind utilities;

@page {
    size: auto;   /* auto is the default value */
    margin: 0;    /* removes default margin */
}

@media print {
    @page {
        size: landscape;
    }

    /* Hide browser's default header and footer */
    html {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Base body padding */
    body {
        min-height: 0 !important;
    }

    .print-container {
        max-width: none !important;
        padding: 1cm !important;
        margin: 0 !important;
    }

    .page-break-after:not(:last-child) {
        page-break-after: always;
    }

    /* Add padding to each recipe "page" in collections */
    .page-break-after {
        padding: 2cm !important;
    }
}

.pagy {
    @apply flex flex-wrap justify-center space-x-2 font-medium text-sm;
}

/* Base link styles */
.pagy a:not(.gap) {
    @apply block rounded-sm px-3 py-2
    text-gray-600 bg-white border border-gray-200
    hover:border-orange-500 hover:text-orange-500
    transition-colors duration-200
    dark:text-gray-300 dark:bg-gray-800 dark:border-gray-700
    dark:hover:text-orange-500 dark:hover:border-orange-500;
}

/* Current page */
.pagy a.current {
    @apply text-white bg-orange-500 border-orange-500
    hover:bg-orange-600 hover:border-orange-600
    dark:bg-orange-500 dark:border-orange-500
    dark:hover:bg-orange-600 dark:hover:border-orange-600;
}

/* Disabled links */
.pagy a:not([href]) {
    @apply text-gray-400 bg-gray-50 border-gray-200 cursor-not-allowed
    hover:text-gray-400 hover:border-gray-200
    dark:text-gray-600 dark:bg-gray-900 dark:border-gray-700
    dark:hover:text-gray-600 dark:hover:border-gray-700;
}

/* Gap indicator */
.pagy .gap {
    @apply px-2 py-2 text-gray-500 dark:text-gray-400;
}

/* Input box styling */
.pagy label {
    @apply inline-flex items-center space-x-2 px-3 py-2
    text-gray-600 bg-white border border-gray-200 rounded-sm
    dark:text-gray-300 dark:bg-gray-800 dark:border-gray-700;
}

.pagy label input {
    @apply w-16 px-2 py-1 ml-2 text-center
    text-gray-900 bg-white border border-gray-200 rounded-sm
    focus:ring-2 focus:ring-orange-500 focus:border-transparent
    dark:text-gray-100 dark:bg-gray-700 dark:border-gray-600;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
    .pagy {
        @apply space-x-1;
    }

    .pagy a:not(.gap) {
        @apply px-2 py-1 text-sm;
    }

    /* Hide some pagination items on mobile */
    .pagy .hide-mobile {
        @apply hidden;
    }
}

/* Scrollbar styling */
.scrollbar-thin::-webkit-scrollbar {
    width: 4px;
}

.scrollbar-thumb-gray-300::-webkit-scrollbar-thumb {
    background-color: rgb(209 213 219);
    border-radius: 2px;
}

.scrollbar-thumb-gray-600::-webkit-scrollbar-thumb {
    background-color: rgb(75 85 99);
    border-radius: 2px;
}

.scrollbar-track-transparent::-webkit-scrollbar-track {
    background-color: transparent;
}

/* Custom styling for Firefox */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgb(209 213 219) transparent;
}

.dark .scrollbar-thin {
    scrollbar-color: rgb(75 85 99) transparent;
}
