/* =============================================
   Just Designs - Main Stylesheet
   ============================================= */

/* ---- Global ---- */
:root {
    --primary-color: #1a1a2e;
    --accent-color: #e94560;
    --gold-color: #f5c518;
    --card-radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* ---- Navbar ---- */
.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

/* ---- Hero Section ---- */
.hero-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.85;
}

/* ---- Image Cards ---- */
.image-card {
    border: none;
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #fff;
    cursor: pointer;
}

.image-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}

.image-card .card-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.image-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.image-card:hover .card-img-wrapper img {
    transform: scale(1.08);
}

.image-card .card-body {
    padding: 12px 14px;
}

.image-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-card .badge-type {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 20px;
}

.image-card .like-count {
    font-size: 0.8rem;
    color: #999;
}

/* ---- Premium Badge ---- */
.badge-premium {
    background: linear-gradient(135deg, #f5c518, #e67e22);
    color: #000;
}

.badge-free {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
}

/* ---- Blurred Premium Images ---- */
.image-card.blurred-card .card-img-wrapper {
    position: relative;
}

.image-card.blurred-card .card-img-wrapper img {
    filter: blur(6px);
    transform: scale(1.1);
}

.image-card.blurred-card .blur-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 10px;
    z-index: 3;
}

.image-card.blurred-card .blur-overlay .lock-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    color: var(--gold-color);
}

.image-card.blurred-card .blur-overlay p {
    font-size: 0.75rem;
    margin: 0;
    line-height: 1.3;
}

/* ---- Load More Button ---- */
#load-more-wrapper {
    text-align: center;
    padding: 30px 0;
}

#load-more-btn {
    padding: 12px 40px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
}

#load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* ---- Image Detail Page ---- */
.detail-primary-img {
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--card-radius);
    width: 100%;
    background: #000;
}

.detail-gallery-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.detail-gallery-thumb:hover,
.detail-gallery-thumb.active {
    border-color: var(--accent-color);
}

/* ---- Like Button ---- */
.like-btn {
    border: none;
    background: none;
    transition: var(--transition);
    font-size: 1.1rem;
}

.like-btn.liked {
    color: var(--accent-color) !important;
}

.like-btn:hover {
    transform: scale(1.2);
}

/* ---- Auth Pages ---- */
.auth-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
    overflow: hidden;
}

.auth-card .auth-header {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    color: #fff;
    padding: 30px;
    text-align: center;
}

.auth-card .auth-header h3 {
    font-weight: 700;
    margin: 0;
}

/* ---- Premium Page Banner ---- */
.premium-banner {
    background: linear-gradient(135deg, #1a1a2e, #f5c518);
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.premium-banner h1 {
    font-weight: 700;
}

/* ---- Subscribe CTA ---- */
.subscribe-cta {
    background: linear-gradient(135deg, #e94560, #c0392b);
    color: #fff;
    padding: 50px;
    border-radius: 16px;
    text-align: center;
    margin: 30px 0;
}

/* ---- Wishlist ---- */
.wishlist-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #fff;
    transition: var(--transition);
}

.wishlist-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.wishlist-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

/* ---- Section Headers ---- */
.section-header {
    text-align: center;
    padding: 40px 0 20px;
}

.section-header h2 {
    font-weight: 700;
    color: #1a1a2e;
}

.section-header .divider {
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* ---- Loading Spinner ---- */
.spinner-wrapper {
    text-align: center;
    padding: 20px;
    display: none;
}

/* ---- Stats Cards (Admin) ---- */
.stat-card {
    border: none;
    border-radius: var(--card-radius);
    color: #fff;
    padding: 24px;
    text-align: center;
}

.stat-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

/* ---- Admin Sidebar ---- */
.admin-sidebar {
    min-height: calc(100vh - 56px);
    background: #1a1a2e;
    padding: 20px 0;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 10px 20px;
    border-radius: 6px;
    margin: 2px 8px;
    transition: var(--transition);
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.admin-sidebar .nav-link i {
    width: 20px;
    margin-right: 8px;
}

/* ---- Image Upload Preview ---- */
#upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

#upload-preview .preview-item {
    position: relative;
    width: 100px;
    height: 80px;
}

#upload-preview .preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #dee2e6;
}

#upload-preview .preview-item.primary-selected img {
    border-color: var(--accent-color);
}

#upload-preview .preview-item label {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.65rem;
    cursor: pointer;
}

/* ---- Responsive Tweaks ---- */
@media (max-width: 768px) {
    .hero-section {
        padding: 50px 0;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    .hero-section p {
        font-size: 1rem;
    }
    .image-card .card-img-wrapper {
        height: 180px;
    }
    .auth-card {
        margin: 15px;
    }
    /* Better touch targets for nav links */
    .navbar .nav-link {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .subscribe-cta {
        padding: 30px 20px;
    }
    /* Share buttons stack nicely on small screens */
    .share-box .d-flex {
        flex-direction: column;
    }
    .btn-share {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .image-card .card-img-wrapper {
        height: 150px;
    }
    .hero-section h1 {
        font-size: 1.6rem;
    }
}

/* ---- Lazy load fade-in ---- */
.lazy {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy.loaded {
    opacity: 1;
}

/* ---- Share Buttons ---- */
.share-box {
    border-top: 1px solid #eee;
    padding-top: 16px;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
    min-height: 44px; /* accessible touch target */
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-share-facebook {
    background-color: #1877f2;
    color: #fff;
}
.btn-share-facebook:hover {
    background-color: #0d6efd;
    color: #fff;
}

.btn-share-linkedin {
    background-color: #0a66c2;
    color: #fff;
}
.btn-share-linkedin:hover {
    background-color: #004182;
    color: #fff;
}

.btn-share-copy {
    background-color: #6c757d;
    color: #fff;
}
.btn-share-copy:hover {
    background-color: #5a6268;
    color: #fff;
}

/* ---- Ensure all interactive elements have a min touch target (mobile) ---- */
.btn,
.nav-link,
.like-btn,
.load-more-btn,
.detail-gallery-thumb {
    min-height: 44px;
    min-width: 44px;
}

/* ---- Smooth image rendering ---- */
img {
    image-rendering: auto;
}
