/*
 * Stock Photos Page Styles
 * Specific styles for stock-photos.blade.php
 * Requires: photo-common.css, magenta-theme.css
 */

/* ========================================================================
   1. HERO SECTION COMPONENTS
   ========================================================================== */

/* Stats Section */
.stats-section {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
    padding: 20px 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #f74780;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    line-height: 1.4;
}

/* Search Box */
.search-box {
    max-width: 600px;
    margin: 0 auto;
}

.search-box form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input[type="text"] {
    width: 100%;
    padding: 15px 60px 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #f74780;
    box-shadow: 0 0 0 4px rgba(247, 71, 128, 0.1);
}

.search-box button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: #f74780;
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background: #d63669;
    transform: translateY(-50%) scale(1.05);
}

.search-box button svg {
    width: 20px;
    height: 20px;
}

/* Category Filter */
.category-filter {
    margin: 40px 0 20px;
}

.category-filter h5 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-badge:hover {
    border-color: #f74780;
    color: #f74780;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 71, 128, 0.15);
}

.category-badge.active {
    background: #f74780;
    border-color: #f74780;
    color: #fff;
}

@media (max-width: 768px) {
    .stats-section {
        gap: 20px;
        flex-wrap: wrap;
    }

    .stat-number {
        font-size: 24px;
    }

    .stat-label {
        font-size: 12px;
    }

    .search-box input[type="text"] {
        padding: 12px 50px 12px 16px;
        font-size: 14px;
    }

    .search-box button {
        width: 38px;
        height: 38px;
    }

    .category-filter h5 {
        font-size: 14px;
    }

    .category-badge {
        padding: 6px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .stats-section {
        gap: 15px;
    }

    .stat-number {
        font-size: 20px;
    }

    .stat-label {
        font-size: 11px;
    }
}

/* ========================================================================
   2. PHOTO GRID LAYOUT - PROFESSIONAL JUSTIFIED GALLERY
   ========================================================================== */
.photo-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    margin-top: 40px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

@media (max-width: 1200px) {
    .photo-grid {
        gap: 6px;
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    .photo-grid {
        gap: 4px;
        margin-top: 25px;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        gap: 3px;
        margin-top: 20px;
    }
}

/* ========================================================================
   3. PHOTO CARD - PROFESSIONAL JUSTIFIED LAYOUT
   ========================================================================== */
.photo-card {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-grow: 0;
    flex-shrink: 0;
}

.photo-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
    z-index: 100;
}

.photo-card-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
    line-height: 0;
}

.photo-card-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: bottom;
}

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

/* Smooth loading effect */
.photo-card-image img {
    opacity: 0;
    animation: fadeInImage 0.4s ease forwards;
}

.photo-card-image img.loaded {
    opacity: 1;
}

@keyframes fadeInImage {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Photo Info (Creator) - Bottom of card */
.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.photo-card:hover .photo-info {
    opacity: 1;
    transform: translateY(0);
}

.photo-creator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.photo-creator-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f74780 0%, #ff6b9d 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.photo-creator-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ========================================================================
   4. PHOTO CARD ACTION BUTTONS (Professional Style)
   ========================================================================== */
.photo-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
}

.photo-card:hover .photo-card-actions {
    opacity: 1;
    transform: translateY(0);
}

.photo-card-action-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
}

.photo-card-action-btn i {
    display: block;
    line-height: 1;
}

.photo-card-action-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 1);
}

.photo-card-action-btn.favorite-btn.active {
    color: #fff;
    background: #f74780;
}

.photo-card-action-btn.favorite-btn:hover {
    color: #fff;
    background: #f74780;
}

.photo-card-action-btn.share-btn:hover {
    color: #fff;
    background: #f74780;
}

@media (max-width: 768px) {
    .photo-card-actions {
        top: 8px;
        right: 8px;
        gap: 4px;
    }

    .photo-card-action-btn {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        font-size: 12px;
    }
}

/* ========================================================================
   4. PHOTO MODAL (Preview)
   ========================================================================== */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-modal.active {
    display: block;
    opacity: 1;
}

.photo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
}

.photo-modal-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1;
}

.photo-modal-content {
    position: relative;
    width: 70%;
    max-width: 70%;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 40px auto 0;
}

.photo-modal-inner {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px 30px;
}

.photo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    min-height: 40px;
}

.photo-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.photo-modal-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.photo-modal-main {
    position: relative;
    width: 100%;
    height: calc(100vh - 350px);
    max-height: calc(100vh - 350px);
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    background-image:
        linear-gradient(45deg, #efefef 25%, transparent 25%, transparent 75%, #efefef 75%, #efefef),
        linear-gradient(45deg, #efefef 25%, transparent 25%, transparent 75%, #efefef 75%, #efefef);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-modal-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.photo-modal-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ========================================================================
   5. PHOTO MODAL NAVIGATION (Prev/Next)
   ========================================================================== */
.photo-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 99999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.photo-modal-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.photo-modal-nav.photo-modal-prev {
    left: 20px;
}

.photo-modal-nav.photo-modal-next {
    right: 20px;
}

.photo-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 99999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.photo-modal-close:hover {
    background: #fff;
    transform: rotate(90deg);
}

/* ========================================================================
   6. INFO MODAL
   ========================================================================== */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-modal.active {
    display: block;
    opacity: 1;
}

.info-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.info-modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.info-modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.info-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.info-modal-close {
    width: 32px;
    height: 32px;
    background: #f3f4f5;
    border: none;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.info-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.info-modal-body {
    padding: 25px;
}

.info-section {
    margin-bottom: 25px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.info-section-content {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-row:first-child {
    padding-top: 0;
}

.info-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.info-value {
    font-size: 13px;
    color: #333;
    font-weight: 600;
    text-align: right;
}

.info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.info-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: #f3f4f5;
    border-radius: 15px;
    font-size: 12px;
    color: #666;
}

.info-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-top: 8px;
}

/* ========================================================================
   7. LOGIN MODAL
   ========================================================================== */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-modal.active {
    display: flex;
}

.login-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.login-modal-container {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: loginModalSlideIn 0.3s ease;
}

@keyframes loginModalSlideIn {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.login-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.login-modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.login-modal-close i {
    font-size: 18px;
    color: #666;
}

.login-modal-content {
    padding: 60px 40px 40px;
    text-align: center;
}

.login-modal-icon {
    margin-bottom: 24px;
    animation: heartBeat 1.5s ease infinite;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(1);
    }
}

.login-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin: 0 0 12px 0;
}

.login-modal-message {
    font-size: 16px;
    color: #666;
    margin: 0 0 32px 0;
    line-height: 1.5;
}

.login-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-login-primary,
.btn-login-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-login-primary {
    background: #f74780;
    color: white;
}

.btn-login-primary:hover {
    background: #d63669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 71, 128, 0.3);
}

.btn-login-secondary {
    background: white;
    color: #f74780;
    border-color: #f74780;
}

.btn-login-secondary:hover {
    background: #fff5f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 71, 128, 0.15);
}

.btn-login-cancel {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

.btn-login-cancel:hover {
    color: #666;
    text-decoration: underline;
}

.btn-login-primary a:hover {
    color: #fff !important;
    text-decoration: none;
}

/* ========================================================================
   8. INFINITE SCROLL - LOADING & END INDICATORS
   ========================================================================== */

/* Loading Indicator */
.infinite-scroll-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    margin-top: 40px;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f0f0f0;
    border-top-color: #f74780;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.infinite-scroll-loading p {
    margin-top: 20px;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* End of Content Indicator */
.infinite-scroll-end {
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
}

.infinite-scroll-end p {
    font-size: 16px;
    color: #999;
    font-weight: 500;
    margin: 0;
    padding: 16px 32px;
    background: #f8f8f8;
    border-radius: 30px;
    display: inline-block;
}

/* ========================================================================
   9. PAGINATION & EMPTY STATE
   ========================================================================== */

/* Pagination */
.pagination-section {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

/* No Photos Message */
.no-photos {
    text-align: center;
    padding: 60px 20px;
}

.no-photos i {
    font-size: 64px;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.no-photos h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.no-photos p {
    font-size: 16px;
    color: #666;
    margin-bottom: 0;
}

/* ========================================================================
   9. RESPONSIVE - MODAL TABLET
   ========================================================================== */
@media (max-width: 768px) {
    .photo-modal-inner {
        padding: 15px 20px;
    }

    .photo-modal-header {
        gap: 10px;
    }

    .photo-modal-header-left {
        gap: 8px;
    }

    .photo-modal-header-right {
        gap: 6px;
    }

    .info-modal-content {
        max-width: 100%;
        border-radius: 0;
    }

    .info-modal-header {
        padding: 15px 20px;
    }

    .info-modal-body {
        padding: 20px;
    }
}

/* ========================================================================
   9. RESPONSIVE - MODAL MOBILE
   ========================================================================== */
@media (max-width: 480px) {
    .photo-modal-inner {
        padding: 10px 15px;
    }

    .photo-modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .photo-modal-header-left {
        width: 100%;
    }

    .photo-modal-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .login-modal-content {
        padding: 50px 24px 24px;
    }

    .login-modal-title {
        font-size: 24px;
    }

    .login-modal-message {
        font-size: 14px;
    }

    .btn-login-primary,
    .btn-login-secondary {
        font-size: 14px;
        padding: 12px 20px;
    }
}

/* ========================================================================
   10. SCROLL TO TOP BUTTON
   ========================================================================== */
.scroll-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 56px;
    height: 56px;
    background: #f74780;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(247, 71, 128, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: #d63669;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(247, 71, 128, 0.4);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}

.scroll-to-top i {
    line-height: 1;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scroll-to-top {
        width: 48px;
        height: 48px;
        bottom: 30px;
        right: 30px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .scroll-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
        font-size: 16px;
    }
}
