/* Photo Modal Styles */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-modal.show {
    display: flex;
    opacity: 1;
}

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

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    z-index: 2;
    background: linear-gradient(rgba(0,0,0,0.8), transparent);
}

.modal-close {
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: scale(1.1);
}

.modal-controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    background: rgba(0,0,0,0.8);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    min-width: 100px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-btn:hover {
    background: rgba(243, 156, 18, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
    border-color: rgba(243, 156, 18, 0.5);
}

.control-btn.active {
    background: rgba(243, 156, 18, 0.8);
    border-color: rgba(243, 156, 18, 0.7);
    box-shadow: 0 3px 10px rgba(243, 156, 18, 0.2);
}

.share-btn-header {
    position: relative;
}

.share-btn-header::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(243, 156, 18, 0.8);
    opacity: 0;
    transition: opacity 0.3s;
}

.share-btn-header:hover::after,
.share-btn-header.active::after {
    opacity: 1;
}

.btn-label {
    font-size: 13px;
    white-space: nowrap;
}

.control-btn svg {
    flex-shrink: 0;
}

.modal-body {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 2rem;
    gap: 3rem;
}

.photo-container {
    flex: 0 0 auto;
    max-width: 70%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-photo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.8);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #f39c12;
    font-size: 18px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(243, 156, 18, 0.3);
    border-radius: 50%;
    border-top-color: #f39c12;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

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

.loading-text {
    margin-top: 1rem;
}

.photo-info {
    flex: 1;
    max-width: 400px;
    color: white;
    overflow-y: auto;
    max-height: 100%;
}

.photo-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    line-height: 1.2;
}

.photo-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 2rem;
}

.photo-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.meta-group {
    text-align: left;
}

.meta-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f39c12;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.meta-content {
    color: #ddd;
    font-size: 0.95rem;
}

.photo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

/* Metadata section */
.metadata-section {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.metadata-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0;
    color: #f39c12;
    font-weight: 600;
    transition: color 0.3s ease;
}

.metadata-toggle:hover {
    color: #e67e22;
}

.caret-icon {
    transition: transform 0.3s ease;
}

.metadata-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.metadata-content.show {
    max-height: 400px;
    margin-top: 1rem;
}

.exif-item {
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.exif-label {
    color: #f39c12;
    font-weight: 600;
    margin-right: 0.5rem;
}

.exif-value {
    color: #ddd;
}

/* Side panels */
.share-panel {
    position: absolute;
    top: 6rem;
    right: 2rem;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    border-radius: 12px;
    max-width: 300px;
    color: white;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 3;
    border: 1px solid rgba(243, 156, 18, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.share-panel.show {
    transform: translateX(0);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

.share-panel h3 {
    color: #f39c12;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
    border-bottom: 1px solid rgba(243, 156, 18, 0.2);
    padding-bottom: 0.5rem;
}

/* Share buttons */
.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.facebook {
    background: #1877f2;
    color: white;
}

.share-btn.facebook:hover {
    background: #166fe5;
}

.share-btn.twitter {
    background: #1da1f2;
    color: white;
}

.share-btn.twitter:hover {
    background: #0d8bd9;
}

.share-btn.pinterest {
    background: #bd081c;
    color: white;
}

.share-btn.pinterest:hover {
    background: #9d0717;
}

.share-btn.reddit {
    background: #ff4500;
    color: white;
}

.share-btn.reddit:hover {
    background: #e63e00;
}

.share-btn.instagram {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    color: white;
}

.share-btn.instagram:hover {
    background: linear-gradient(45deg, #e6883c 0%,#d85632 25%,#cb1e3a 50%,#bb1a5c 75%,#ab0f7f 100%);
}

.share-btn.whatsapp {
    background: #25d366;
    color: white;
}

.share-btn.whatsapp:hover {
    background: #20b954;
}

.share-btn.email {
    background: #6b7280;
    color: white;
}

.share-btn.email:hover {
    background: #4b5563;
}

.share-btn.copy {
    background: #374151;
    color: white;
}

.share-btn.copy:hover {
    background: #1f2937;
}

/* Mobile responsive */
@media (max-width: 1024px) {
    .modal-body {
        flex-direction: column;
        padding: 6rem 1rem 2rem;
        gap: 2rem;
    }
    
    .photo-container {
        max-width: 100%;
        max-height: 60vh;
    }
    
    .photo-info {
        max-width: 100%;
        text-align: center;
    }
    
    .photo-meta {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .share-panel {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-controls {
        gap: 0.5rem;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
    }
    
    .control-btn {
        min-width: 80px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .btn-label {
        font-size: 11px;
    }
    
    .share-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .photo-title {
        font-size: 1.5rem;
    }
    
    .photo-description {
        font-size: 1rem;
    }
    
    .photo-container {
        max-height: 50vh;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Right-click protection for modal photos */
.modal-photo {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}