/*
 * Photo Common Styles
 * Shared CSS for stock-photos.blade.php and photo-detail.blade.php
 * Uses magenta theme colors: #f74780 (primary), #d63669 (hover)
 */

/* ========================================================================
   1. CSS VARIABLES
   ========================================================================== */
:root {
    --theme-color: #f74780;
    --theme-hover: #d63669;
    --theme-shadow: rgba(247, 71, 128, 0.3);
    --theme-light-bg: rgba(247, 71, 128, 0.1);
}

/* ========================================================================
   2. PHOTO AUTHOR SECTION (Used in: header, modal)
   ========================================================================== */
.photo-author-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.photo-author-info h1 {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.photo-author-info .author-link {
    font-size: 13px;
    font-weight: 500;
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.photo-author-info .author-link:hover {
    color: var(--theme-color);
}

/* ========================================================================
   3. ACTION BUTTONS (Favorite, Share, Download, etc.)
   ========================================================================== */
.modal-action-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-action-btn:hover {
    border-color: var(--theme-color);
    color: var(--theme-color);
    transform: scale(1.05);
}

.modal-action-btn.favorite-btn:hover,
.modal-action-btn.share-btn:hover {
    background: var(--theme-color);
    border-color: var(--theme-color);
    color: #fff;
}

.modal-action-btn.favorite-btn.active {
    background: var(--theme-color);
    border-color: var(--theme-color);
    color: #fff;
}

.modal-action-btn.btn-primary {
    background: var(--theme-color);
    border-color: var(--theme-color);
    color: #fff;
    width: auto;
    min-width: 120px;
    padding: 0 20px;
    border-radius: 21px;
    gap: 8px;
}

.modal-action-btn.btn-primary:hover {
    background: var(--theme-hover);
    border-color: var(--theme-hover);
    box-shadow: 0 4px 12px var(--theme-shadow);
}

.modal-action-btn.btn-primary span {
    font-size: 14px;
    font-weight: 600;
    display: none;
}

@media (min-width: 768px) {
    .modal-action-btn.btn-primary span {
        display: inline-block;
    }
}

.header-divider {
    width: 1px;
    height: 30px;
    background: #e0e0e0;
}

/* ========================================================================
   4. PHOTO DETAILS SECTION
   ========================================================================== */
.photo-details-section {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
}

.photo-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-value.category {
    color: var(--theme-color);
}

.detail-item:has(.stats) {
    align-items: center;
}

.detail-item:has(.stats) .detail-label {
    text-align: center;
}

/* Center Dimensions */
.detail-item:has(#modal-dimensions) {
    align-items: center;
}

.detail-item:has(#modal-dimensions) .detail-label {
    text-align: center;
}

.detail-item:has(#modal-dimensions) .detail-value {
    justify-content: center;
}

.detail-value.stats {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
}

.stat-item i {
    color: #999;
    font-size: 13px;
}

.photo-description {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.photo-description p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 8px 0 0 0;
}

/* ========================================================================
   5. TAGS SECTION
   ========================================================================== */
.tags-section-main {
    padding: 20px 0;
}

.tags-wrapper {
    position: relative;
}

.tags-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 10px;
}

.tags-carousel::-webkit-scrollbar {
    display: none;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 16px;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.tag-badge:hover {
    background: #f3f4f5;
    color: #333;
    border-color: #d0d0d0;
}

/* ========================================================================
   6. RELATED IMAGES CAROUSEL
   ========================================================================== */
.related-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.related-section h6 {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
}

.carousel-wrapper {
    position: relative;
}

.related-images-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 10px;
}

.related-images-carousel::-webkit-scrollbar {
    display: none;
}

.related-image-item {
    position: relative;
    width: 300px;
    height: 200px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.related-image-item:hover {
    transform: scale(1.02);
}

.related-image-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    z-index: 1;
}

.related-image-item:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

.related-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    background: #fff;
    border: none;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 2;
}

.carousel-nav:hover {
    color: #333;
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: -15px;
}

.carousel-nav.next {
    right: -15px;
}

/* ========================================================================
   7. TOAST NOTIFICATION
   ========================================================================== */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification i {
    font-size: 18px;
}

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

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

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

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

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

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

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

.share-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;
}

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

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

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.share-buttons .share-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.share-buttons .share-btn.twitter {
    background: #1DA1F2;
}

.share-buttons .share-btn.facebook {
    background: #1877F2;
}

.share-buttons .share-btn.line {
    background: #06C755;
}

.share-btn-label {
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.share-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.share-url-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.share-url-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.share-url-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-url-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    cursor: text;
}

.share-url-input:focus {
    outline: none;
    border-color: var(--theme-color);
    background: #fff;
}

.share-copy-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--theme-color);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-copy-btn:hover {
    background: var(--theme-hover);
    box-shadow: 0 4px 12px var(--theme-shadow);
}

.share-copy-btn.copied {
    background: #28a745;
}

/* ========================================================================
   9. LOADING SPINNER
   ========================================================================== */
.photo-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(242, 242, 242, 0.9);
    z-index: 1;
}

.photo-loading.hidden {
    display: none;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid #FFF;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

.loader::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: var(--theme-color);
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ========================================================================
   10. RESPONSIVE - TABLET
   ========================================================================== */
@media (max-width: 768px) {
    .photo-author-info h1 {
        font-size: 11px;
    }

    .photo-author-info .author-link {
        font-size: 11px;
    }

    .modal-action-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .modal-action-btn.btn-primary {
        min-width: 100px !important;
        padding: 0 15px !important;
    }

    .modal-action-btn.btn-primary span {
        display: inline-block !important;
        font-size: 13px;
    }

    .header-divider {
        height: 28px;
    }

    .related-image-item {
        width: 250px;
        height: 167px;
    }

    .carousel-nav {
        width: 30px;
        height: 30px;
    }
}

/* ========================================================================
   11. RESPONSIVE - MOBILE
   ========================================================================== */
@media (max-width: 480px) {
    .photo-author-section .photo-creator-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .photo-author-info h1 {
        font-size: 10px;
    }

    .photo-author-info .author-link {
        font-size: 10px;
    }

    .modal-action-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .header-divider {
        display: none;
    }

    .related-image-item {
        width: 200px;
        height: 133px;
    }

    .share-modal-content {
        max-width: 100%;
    }
}
