﻿/* Hide scrollbar but keep the element scrollable */
.hide-scrollbar {
    overflow: auto; /* ensure scrolling still works if content overflows */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

    /* WebKit browsers (Chrome, Safari, Opera) */
    .hide-scrollbar::-webkit-scrollbar {
        display: none;
    }

/* If you want to completely disable scrolling instead of hiding the scrollbar,
   use `overflow: hidden;` on the element, but be careful with accessibility. */

/* --------------------------------------------------
   UserSetting page styles
   -------------------------------------------------- */
.page-settings {
    color: #212529;
}

    .page-settings h2#title {
        margin-bottom: 1rem;
        font-weight: 600;
    }

.page-gallery {
    color: #212529;
}

    .page-gallery h2#gallery-title {
        margin-bottom: 1rem;
        font-weight: 600;
    }

.settings-topbar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(0,0,0,0.03);
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.settings-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 0.6rem;
    padding: 1rem;
    box-shadow: 0 1px 6px rgba(16,24,40,0.03);
}

    .settings-card h5 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        font-weight: 600;
    }

.form-row-gap > .col-md-4 {
    margin-bottom: 0.75rem;
}

.placeholder-box {
    background: linear-gradient(180deg, #fbfbfd, #f7f7fb);
    border: 1px dashed rgba(0,0,0,0.05);
    border-radius: 0.5rem;
}

/* Saved list */
.saved-list {
    max-height: 36vh;
    overflow-y: auto;
    padding: 0.25rem;
}

.saved-list-empty {
    padding: 0.75rem 0.5rem;
    color: #6c757d;
}

.saved-item {
    padding: 0.55rem 0.6rem;
    border-radius: 0.45rem;
    margin-bottom: 0.45rem;
    cursor: pointer;
    transition: all .18s ease-in-out;
    border: 1px solid transparent;
}

    .saved-item small {
        color: rgba(0,0,0,0.45);
    }

    .saved-item:hover {
        background: rgba(0,123,255,0.06);
        transform: translateY(-1px);
        border-color: rgba(0,123,255,0.12);
    }

    /* Selected state */
    .saved-item.selected {
        background: #0d6efd; /* bootstrap primary */
        color: #fff;
        box-shadow: 0 6px 18px rgba(13,110,253,0.12);
        transform: none;
        border-color: rgba(13,110,253,0.2);
    }

        .saved-item.selected small {
            color: rgba(255,255,255,0.85);
        }

/* Buttons inside the right column */
.settings-card .d-grid .btn {
    padding: 0.5rem 0.75rem;
}

/* Make inputs & selects slightly larger and more touch-friendly */
.page-settings .form-control,
.page-settings .form-select {
    min-height: 42px;
    padding: 0.5rem 0.75rem;
}

/* Responsive small devices: stack topbar content */
@media (max-width: 767.98px) {
    .settings-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .saved-list {
        max-height: 28vh;
    }
}

/* Accessibility: focus outlines for keyboard users */
.saved-item:focus {
    outline: 3px solid rgba(13,110,253,0.18);
    outline-offset: 2px;
}

/* Small utility tweak to prevent overly long file names from breaking layout */
.saved-item {
    word-break: break-word;
}
/* Gallery page styles */
.page-gallery .user-bar {
    color: #6c757d;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.page-gallery .frame {
    display: none;
}
/* legacy */

.page-gallery .settings-card {
    padding: 1rem;
}

.page-gallery .pager {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

    .page-gallery .pager .arrow {
        background: transparent;
        border: 1px solid rgba(0,0,0,0.06);
        border-radius: 0.35rem;
        padding: 0.35rem 0.5rem;
        cursor: pointer;
        transition: all .12s;
    }

        .page-gallery .pager .arrow:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.06);
        }

    .page-gallery .pager .page {
        padding: 0.25rem 0.5rem;
        background: rgba(0,0,0,0.03);
        border-radius: 0.25rem;
        font-size: 0.95rem;
    }

.page-gallery .grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* fixed 6 columns on wide screens */
    gap: 1rem;
}

.page-gallery .card.gallery-item {
    border-radius: 0.55rem;
    overflow: hidden;
    background: linear-gradient(180deg,#fff,#fbfbff);
    border: 1px solid rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    transition: all .14s ease;
    min-height: 0; /* allow flex children to size correctly */
}

.page-gallery .preview-wrap {
    position: relative;
    padding-top: 66%; /* keep a pleasant aspect ratio */
    overflow: hidden;
    background: #f1f3f5;
}

.page-gallery .preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .page-gallery .preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.page-gallery .diag {
    position: absolute;
    left: 8px;
    bottom: 8px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    padding: 3px 6px;
    border-radius: 0.25rem;
    font-size: 0.78rem;
}

.page-gallery .controls {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem;
    justify-content: center;
}

.page-gallery .btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    border-radius: 0.35rem;
}

.page-gallery .btn-del {
    border: 1px solid rgba(220,53,69,0.15);
    background: transparent;
    color: #dc3545;
}

    .page-gallery .btn-del:hover {
        background: rgba(220,53,69,0.06);
    }

.page-gallery .btn-details {
    background: #0d6efd;
    color: #fff;
    border: 1px solid rgba(13,110,253,0.12);
}

/* Selected state matches saved-item.selected style */
.page-gallery .gallery-item.selected {
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 8px 24px rgba(13,110,253,0.12);
    border-color: rgba(13,110,253,0.18);
}

    .page-gallery .gallery-item.selected .diag {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }

.page-gallery .gallery-item:focus {
    outline: 3px solid rgba(13,110,253,0.12);
    outline-offset: 2px;
}

@media (max-width: 1199.98px) {
    .page-gallery .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767.98px) {
    .page-gallery .grid { grid-template-columns: repeat(2, 1fr); }
    .page-gallery .preview-wrap { padding-top: 75%; }
}

/* Auth forms (Login / Register) */
.form-container {
    max-width: 420px;
    margin: 2.25rem auto;
    background: #ffffff;
    border-radius: 0.6rem;
    padding: 1.5rem 1.25rem;
    box-shadow: 0 10px 30px rgba(12,24,48,0.06);
    border: 1px solid rgba(0,0,0,0.04);
}

    .form-container h2 {
        font-size: 1.15rem;
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .form-container .mb-3 label {
        font-weight: 600;
    }

/* Custom primary button (used by login/register) */
.btn-custom {
    display: inline-block;
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: linear-gradient(180deg,#0d6efd,#0b5ed7);
    color: #fff;
    border: 1px solid rgba(13,110,253,0.18);
    border-radius: 0.45rem;
    box-shadow: 0 6px 18px rgba(13,110,253,0.12);
    font-weight: 600;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}

    .btn-custom:hover {
        transform: translateY(-2px);
        opacity: 0.98;
    }

/* Make inputs slightly larger and clearer */
.form-container .form-control {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(0,0,0,0.08);
    transition: box-shadow .12s ease, border-color .12s ease;
}

    .form-container .form-control:focus {
        outline: none;
        border-color: rgba(13,110,253,0.5);
        box-shadow: 0 6px 18px rgba(13,110,253,0.06);
    }

/* Validation summary and messages */
.form-container .alert-danger {
    margin-top: 0.5rem;
}

.text-danger {
    font-size: 0.9rem;
}

.link-text {
    margin-top: 1rem;
    text-align: center;
}

    .link-text a {
        color: #0d6efd;
        font-weight: 600;
    }

/* Small screens tweak */
@media (max-width: 575.98px) {
    .form-container {
        margin: 1rem 1rem;
        padding: 1rem;
    }
}

/* Animation for invalid-shake used by login/register pages */
.invalid-shake {
    animation: shake .35s ease;
}

@keyframes shake {
    0% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(-6px)
    }

    50% {
        transform: translateX(6px)
    }

    75% {
        transform: translateX(-3px)
    }

    100% {
        transform: translateX(0)
    }
}
