/* Main stylesheet - Additional custom styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.gallery-modal-open {
    overflow: hidden;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.container {
    max-width: 1280px;
}

/* Card styles inspired by shadcn */
.card {
    @apply border border-border rounded-lg bg-card text-card-foreground;
}

.card-header {
    @apply px-6 py-4 border-b border-border;
}

.card-body {
    @apply px-6 py-4;
}

.card-footer {
    @apply px-6 py-4 border-t border-border;
}

/* Button styles */
.btn {
    @apply px-4 py-2 rounded-md font-medium transition inline-flex items-center justify-center gap-2;
}

.btn-primary {
    @apply bg-accent text-accent-foreground hover:opacity-90;
}

.btn-secondary {
    @apply bg-muted text-muted-foreground hover:bg-muted/80;
}

.btn-outline {
    @apply border border-border text-foreground hover:bg-muted;
}

/* Form styles */
input, select, textarea {
    @apply w-full px-3 py-2 border border-input rounded-md bg-background text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition;
}

/* Table styles */
table {
    @apply w-full border-collapse;
}

.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

.overflow-x-auto > table {
    min-width: max(100%, 48rem);
}

th, td {
    @apply px-4 py-2 text-left border-b border-border;
}

th {
    @apply bg-muted font-bold;
}

tr:hover {
    @apply bg-muted/50;
}

/* Layout utilities */
.page-content {
    width: 100%;
    padding-left: clamp(1rem, 3vw, 2.5rem);
    padding-right: clamp(1rem, 3vw, 2.5rem);
}

.page-content > [class*="max-w-"] {
    max-width: none !important;
    width: 100%;
}

.auth-page-content {
    width: auto;
    flex: 1 1 0%;
}

.item-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.item-gallery-thumb {
    position: relative;
    display: block;
    width: 100%;
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    overflow: hidden;
    background: hsl(var(--card));
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-gallery-thumb:hover,
.item-gallery-thumb:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.item-gallery-thumb-image {
    display: block;
    width: 100%;
    height: 12rem;
    object-fit: cover;
}

.item-gallery-thumb-badge {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.item-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
}

.item-gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(10px);
}

.item-gallery-lightbox-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(96vw, 1360px);
    height: 100vh;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

.item-gallery-lightbox-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    color: #f8fafc;
}

.item-gallery-lightbox-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.item-gallery-lightbox-counter {
    margin: 0.25rem 0 0;
    color: rgba(226, 232, 240, 0.85);
    font-size: 0.95rem;
}

.item-gallery-lightbox-stage {
    flex: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    min-height: 0;
}

.item-gallery-lightbox-close,
.item-gallery-lightbox-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(226, 232, 240, 0.18);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.46);
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.item-gallery-lightbox-nav:disabled {
    opacity: 0.4;
    cursor: default;
}

.item-gallery-lightbox-figure {
    min-width: 0;
    margin: 0;
    min-height: 0;
}

.item-gallery-lightbox-image {
    display: block;
    width: 100%;
    max-height: calc(100vh - 11rem);
    object-fit: contain;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.item-gallery-lightbox-caption {
    margin-top: 0.85rem;
    color: rgba(226, 232, 240, 0.88);
    font-size: 0.95rem;
    text-align: center;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .hidden-mobile {
        display: none;
    }

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

    .item-gallery-lightbox-shell {
        width: 100%;
        padding: 1rem 0.75rem;
    }

    .item-gallery-lightbox-topbar {
        align-items: center;
    }

    .item-gallery-lightbox-stage {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .item-gallery-lightbox-nav,
    .item-gallery-lightbox-close {
        width: 100%;
        border-radius: 0.75rem;
    }

    .item-gallery-lightbox-figure {
        order: -1;
    }

    .item-gallery-lightbox-image {
        max-height: calc(100vh - 16rem);
    }
}

@media (min-width: 769px) {
    .hidden-desktop {
        display: none;
    }
}

@media (max-width: 480px) {
    .item-gallery-grid {
        grid-template-columns: 1fr;
    }
}
