/* Lovepage Gallery Styles */

.lovepage-upload-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.lovepage-upload-intro {display:none !important;
    text-align: center;
    margin-bottom: 30px;
}

.lovepage-upload-intro h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.lovepage-upload-intro p {
    color: #666;
    font-size: 16px;
}

.lovepage-limits {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.limit-item {
    text-align: center;
}

.limit-label {
    display: block;
    font-size: 14px;
    color: #888;
    margin-bottom: 5px;
}

.limit-count {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #333;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 3px dashed #555;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.file-upload-label:hover {
    background: #f0f0f0;
    border-color: #333;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.preview-item img,
.preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #d9534f;
}

.lovepage-submit-btn {
    width: 100%;
    padding: 16px;
    background: #333;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.lovepage-submit-btn:hover {
    background: #000;
}

.lovepage-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.upload-progress {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #333;
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: #666;
}

.upload-messages {
    margin-top: 20px;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Gallery Styles */

.lovepage-gallery-wrapper {
    padding: 20px;
}

.lovepage-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-author {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    font-size: 14px;
}

.no-uploads {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
}

/* Responsive */

@media (max-width: 768px) {
    .lovepage-upload-wrapper {
        padding: 20px;
    }
    
    .lovepage-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .lovepage-limits {
        flex-direction: column;
        gap: 15px;
    }
}

/* Moderation Styles */

.lovepage-moderate-wrapper {
    padding: 20px;
}

.moderate-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.moderate-header h2 {
    color: #d4a574;
    margin-bottom: 10px;
}

.lovepage-moderate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.moderate-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.moderate-item:hover {
    transform: scale(1.02);
}

.moderate-item:hover .moderate-overlay {
    opacity: 1;
}

.moderate-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moderate-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.9));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}

.photo-author,
.photo-date {
    color: white;
    font-size: 14px;
    display: block;
}

.photo-date {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin-top: 5px;
}

.delete-photo-btn {
    background: #d9534f;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
    margin-top: auto;
}

.delete-photo-btn:hover {
    background: #c9302c;
}

/* Lightbox */

.lovepage-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.lovepage-lightbox.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.lightbox-close:hover {
    background: #333;
    color: white;
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    color: #333;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 100000;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

/* ==================== MOBILE UPLOAD FORM ==================== */
@media (max-width: 768px) {
    .lovepage-upload-wrapper {
        padding: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .lovepage-upload-intro h2 {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .lovepage-upload-intro p {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .lovepage-limits {
        margin-bottom: 12px;
        padding: 10px;
    }
    
    .file-upload-label {
        min-height: 100px;
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .upload-icon {
        font-size: 35px;
        margin-bottom: 5px;
    }
    
    .upload-text {
        font-size: 15px;
    }
    
    .file-preview {
        margin: 12px 0;
        gap: 6px;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .preview-item {
        width: calc(33.33% - 4px);
        height: 70px;
    }
    
    .lovepage-submit-btn {
        padding: 14px;
        font-size: 16px;
        margin-top: 10px;
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        background: #e91e63;
        z-index: 999;
        box-shadow: 0 -3px 15px rgba(0,0,0,0.2);
        border-radius: 8px;
    }
    
    .upload-messages {
        margin-top: 8px;
        font-size: 13px;
        max-height: 100px;
        overflow-y: auto;
    }
    
    .message {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ==================== USER PHOTOS SECTION ==================== */
.user-photos-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
}

.user-photos-section h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}

.user-photos-help {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

.user-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.user-photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.user-photo-item:hover {
    transform: scale(1.02);
}

.user-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-own-photo-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 0, 0, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.user-photo-item:hover .delete-own-photo-btn {
    opacity: 1;
}

.delete-own-photo-btn:hover {
    background: rgba(200, 0, 0, 1);
    transform: scale(1.1);
}

.delete-own-photo-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .user-photos-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .user-photo-item {
        border-radius: 6px;
    }
    
    .delete-own-photo-btn {
        opacity: 1;
        width: 28px;
        height: 28px;
        font-size: 14px;
        top: 5px;
        right: 5px;
    }
}

/* Info Box - Come gestire le foto */
.lovepage-info-box {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 20px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
    border-left: 4px solid #2196F3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.lovepage-info-box .info-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.lovepage-info-box .info-content {
    flex: 1;
}

.lovepage-info-box .info-content strong {
    display: block;
    color: #1976D2;
    font-size: 15px;
    margin-bottom: 5px;
    font-weight: 600;
}

.lovepage-info-box .info-content p {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive per mobile */
@media (max-width: 600px) {
    .lovepage-info-box {
        padding: 12px 15px;
        gap: 12px;
    }
    
    .lovepage-info-box .info-icon {
        font-size: 20px;
    }
    
    .lovepage-info-box .info-content strong {
        font-size: 17px;
    }
    
    .lovepage-info-box .info-content p {
        font-size: 16px;
    }
}
