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

@layer utilities {
    .perspective {
        perspective: 1000px;
    }

    .transform-style-3d {
        transform-style: preserve-3d;
    }

    .backface-hidden {
        backface-visibility: hidden;
    }

    .rotateY-180 {
        transform: rotateY(180deg);
    }

    .rotate-y-180 {
        transform: rotateY(180deg);
    }

    /* Card transition animations */
    .card-exit {
        opacity: 0;
        transform: translateX(-20px);
        transition: all 0.2s ease-out;
    }

    .card-enter {
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.2s ease-out;
    }

    /* Books page utilities */
    .line-clamp-2 {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .aspect-\[3\/4\] {
        aspect-ratio: 3 / 4;
    }
}

@layer components {
    .btn-primary {
        @apply py-2 px-4 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors;
    }

    .btn-secondary {
        @apply py-2 px-4 bg-gray-200 text-gray-800 rounded-lg hover:bg-gray-300 transition-colors;
    }

    .btn-ghost {
        @apply py-2 px-4 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors;
    }

    .btn-outline {
        @apply py-2 px-4 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors;
    }

    .card {
        @apply bg-white rounded-lg shadow-sm border border-gray-200;
    }

    .card-header {
        @apply p-4 pb-0;
    }

    .card-body {
        @apply p-4;
    }

    .badge {
        @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
    }

    .badge-primary {
        @apply bg-blue-100 text-blue-800;
    }

    .ml-2 {
        margin-left: 0.5rem;
    }

    .badge-secondary {
        @apply bg-gray-100 text-gray-800;
    }

    .container {
        @apply max-w-7xl mx-auto;
    }

    .space-y-1>*+* {
        margin-top: 0.25rem;
    }

    .space-y-2>*+* {
        margin-top: 0.5rem;
    }

    .space-y-3>*+* {
        margin-top: 0.75rem;
    }

    .space-y-4>*+* {
        margin-top: 1rem;
    }

    .space-y-6>*+* {
        margin-top: 1.5rem;
    }

    .space-y-8>*+* {
        margin-top: 2rem;
    }

    .space-y-12>*+* {
        margin-top: 3rem;
    }

    .gap-6 {
        gap: 1.5rem;
    }

    .gap-8 {
        gap: 2rem;
    }

    .grid-cols-1 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .md\:grid-cols-2 {
        @media (min-width: 768px) {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    .lg\:grid-cols-3 {
        @media (min-width: 1024px) {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }
    }

    .lg\:grid-cols-12 {
        @media (min-width: 1024px) {
            grid-template-columns: repeat(12, minmax(0, 1fr));
        }
    }

    .lg\:col-span-4 {
        @media (min-width: 1024px) {
            grid-column: span 4 / span 4;
        }
    }

    .grid {
        display: grid;
    }

    .flex {
        display: flex;
    }

    .items-center {
        align-items: center;
    }

    .items-start {
        align-items: flex-start;
    }

    .justify-center {
        justify-content: center;
    }

    .justify-between {
        justify-content: space-between;
    }

    .text-center {
        text-align: center;
    }

    .relative {
        position: relative;
    }

    .absolute {
        position: absolute;
    }

    .top-0 {
        top: 0;
    }

    .right-0 {
        right: 0;
    }

    .mb-2 {
        margin-bottom: 0.5rem;
    }

    .mb-3 {
        margin-bottom: 0.75rem;
    }

    .mb-4 {
        margin-bottom: 1rem;
    }

    .mb-6 {
        margin-bottom: 1.5rem;
    }

    .mb-6 {
        margin-bottom: 1.5rem;
    }

    .mb-8 {
        margin-bottom: 2rem;
    }

    .mb-12 {
        margin-bottom: 3rem;
    }

    .mt-1 {
        margin-top: 0.25rem;
    }

    .mt-2 {
        margin-top: 0.5rem;
    }

    .mt-6 {
        margin-top: 1.5rem;
    }

    .mt-8 {
        margin-top: 2rem;
    }

    .py-8 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .py-12 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .p-4 {
        padding: 1rem;
    }

    .p-6 {
        padding: 1.5rem;
    }

    .p-8 {
        padding: 2rem;
    }

    .pb-1 {
        padding-bottom: 0.25rem;
    }

    .pb-2 {
        padding-bottom: 0.5rem;
    }

    .pb-3 {
        padding-bottom: 0.75rem;
    }

    .pt-4 {
        padding-top: 1rem;
    }

    .w-full {
        width: 100%;
    }

    .w-fit {
        width: fit-content;
    }

    .max-w-xs {
        max-width: 20rem;
    }

    .max-w-2xl {
        max-width: 42rem;
    }

    .h-32 {
        height: 8rem;
    }

    .h-full {
        height: 100%;
    }

    .text-xs {
        font-size: 0.75rem;
        line-height: 1rem;
    }

    .text-sm {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }

    .text-lg {
        font-size: 1.125rem;
        line-height: 1.75rem;
    }

    .text-xl {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    .text-xl {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    .text-2xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    .text-4xl {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }

    .font-medium {
        font-weight: 500;
    }

    .font-semibold {
        font-weight: 600;
    }

    .py-3 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .px-3 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .font-bold {
        font-weight: 700;
    }

    .leading-tight {
        line-height: 1.25;
    }

    .leading-relaxed {
        line-height: 1.625;
    }

    .rounded-lg {
        border-radius: 0.5rem;
    }

    .rounded-xl {
        border-radius: 0.75rem;
    }

    .border-2 {
        border-width: 2px;
    }

    .border-b-2 {
        border-bottom-width: 2px;
    }

    .border-t {
        border-top-width: 1px;
    }

    .border-slate-200 {
        border-color: rgb(226 232 240);
    }

    .border-slate-300 {
        border-color: rgb(203 213 225);
    }

    .border-slate-800 {
        border-color: rgb(30 41 59);
    }

    .bg-slate-50 {
        background-color: rgb(248 250 252);
    }

    .bg-slate-100 {
        background-color: rgb(241 245 249);
    }

    .bg-slate-200 {
        background-color: rgb(226 232 240);
    }

    .bg-slate-300 {
        background-color: rgb(203 213 225);
    }

    .bg-slate-600 {
        background-color: rgb(71 85 105);
    }

    .bg-slate-800 {
        background-color: rgb(30 41 59);
    }

    .bg-white {
        background-color: rgb(255 255 255);
    }

    .bg-yellow-300 {
        background-color: rgb(253 224 71);
    }

    .bg-orange-500 {
        background-color: rgb(249 115 22);
    }

    .bg-orange-600 {
        background-color: rgb(234 88 12);
    }

    .bg-blue-600 {
        background-color: rgb(37 99 235);
    }

    .bg-blue-700 {
        background-color: rgb(29 78 216);
    }

    .bg-gray-50 {
        background-color: rgb(249 250 251);
    }

    .bg-gray-100 {
        background-color: rgb(243 244 246);
    }

    .bg-gray-200 {
        background-color: rgb(229 231 235);
    }

    .bg-gray-300 {
        background-color: rgb(209 213 219);
    }

    .text-slate-500 {
        color: rgb(100 116 139);
    }

    .text-slate-600 {
        color: rgb(71 85 105);
    }

    .text-slate-700 {
        color: rgb(51 65 85);
    }

    .text-slate-800 {
        color: rgb(30 41 59);
    }

    .text-white {
        color: rgb(255 255 255);
    }

    .text-gray-600 {
        color: rgb(75 85 99);
    }

    .text-gray-700 {
        color: rgb(55 65 81);
    }

    .text-gray-800 {
        color: rgb(31 41 55);
    }

    .text-blue-600 {
        color: rgb(37 99 235);
    }

    .hover\:bg-orange-600:hover {
        background-color: rgb(234 88 12);
    }

    .hover\:bg-blue-700:hover {
        background-color: rgb(29 78 216);
    }

    .hover\:bg-gray-50:hover {
        background-color: rgb(249 250 251);
    }

    .hover\:bg-gray-300:hover {
        background-color: rgb(209 213 219);
    }

    .hover\:shadow-lg:hover {
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    }

    .transition-colors {
        transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
        transition-duration: 150ms;
    }

    .transition-shadow {
        transition-property: box-shadow;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
        transition-duration: 150ms;
    }

    .shadow-lg {
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    }

    .shadow-xl {
        box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    }

    .shadow-sm {
        box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    }

    .cursor-pointer {
        cursor: pointer;
    }

    .block {
        display: block;
    }

    .inline-block {
        display: inline-block;
    }

    .inline-flex {
        display: inline-flex;
    }

    .flex-1 {
        flex: 1 1 0%;
    }

    .mr-1 {
        margin-right: 0.25rem;
    }

    .mr-2 {
        margin-right: 0.5rem;
    }

    .ml-1 {
        margin-left: 0.25rem;
    }

    .min-h-screen {
        min-height: 100vh;
    }

    .bg-gradient-to-br {
        background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
    }

    .from-slate-50 {
        --tw-gradient-from: rgb(248 250 252);
        --tw-gradient-to: rgb(248 250 252 / 0);
        --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
    }

    .to-slate-100 {
        --tw-gradient-to: rgb(241 245 249);
    }
}
/* Flashcard styles */

/* 3D perspective and rotation styles */
.perspective {
    perspective: 1000px;
}

.transform-style-3d {
    transform-style: preserve-3d;
}

.backface-hidden {
    backface-visibility: hidden;
}

.rotateY-180 {
    transform: rotateY(180deg);
}

.is-flipped {
    transform: rotateY(180deg);
}

/* Button and active states */
[data-active="true"] {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

/* Smooth transitions for navigation */
#flashcard-frame {
    transition: opacity 0.2s ease;
}

.navigation-btn {
    transition: color 0.15s ease, transform 0.1s ease;
}

.navigation-btn:active {
    transform: scale(0.98);
}

/* Enhanced card transitions */
.card-container {
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform, opacity;
}

.card-enter {
    opacity: 0;
    transform: translateX(20px);
}

.card-exit {
    opacity: 0;
    transform: translateX(-20px);
}

/* Better button styles */
.nav-button {
    transition: all 0.2s ease;
}

.nav-button:hover {
    transform: translateY(-1px);
}

.nav-button:active {
    transform: translateY(0);
}

/* Audio button styles */
[data-flashcard-target="audioButton"] {
    cursor: pointer;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
