/* Gallery Styles */

/* Navigation Fixed */
.fixed-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-logo {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: #5B8AAE;
    text-decoration: none;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #5A5A5A;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #5B8AAE;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: #5B8AAE;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #5B8AAE;
    margin: 3px 0;
    transition: 0.3s;
}

/* Gallery Hero */
.gallery-hero {
    background: linear-gradient(135deg, #B8D4E3, #E8F4F8);
    min-height: 60vh;
    display: flex;
    align-items: center;
    text-align: center;
    margin-top: 80px;
}

.gallery-hero .hero-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.gallery-hero h1 {
    font-size: 3.5rem;
    color: #5B8AAE;
    margin-bottom: 1rem;
}

.gallery-hero p {
    font-size: 1.3rem;
    color: #5A5A5A;
    margin-bottom: 2rem;
}

.gallery-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #5B8AAE;
    font-family: 'Dancing Script', cursive;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Category Filter */
.category-filter {
    margin-bottom: 3rem;
}

.category-filter h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.category-card.active {
    border-color: #5B8AAE;
    background: #f8fbfd;
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    color: #5B8AAE;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.photo-count {
    color: #666;
    font-size: 0.9rem;
}

/* Gallery Actions */
.gallery-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active,
.view-btn:hover {
    background: #5B8AAE;
    color: white;
    border-color: #5B8AAE;
}

.download-options {
    display: flex;
    gap: 1rem;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.photo-grid.masonry {
    columns: 4;
    column-gap: 1.5rem;
}

.photo-grid.masonry .photo-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.photo-item {
    position: relative;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.photo-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover .photo-container img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.1) 50%,
        rgba(0,0,0,0.8) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-self: center;
}

.action-btn {
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.action-btn:hover {
    background: white;
    transform: scale(1.05);
}

.featured-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 193, 7, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.photo-info {
    color: white;
    text-align: center;
}

.photo-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-family: 'Open Sans', sans-serif;
}

.photo-category,
.photo-date {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.photo-checkbox {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
}

.photo-checkbox input[type="checkbox"] {
    display: none;
}

.photo-checkbox label {
    display: block;
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.8);
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.photo-checkbox input[type="checkbox"]:checked + label {
    background: #5B8AAE;
    border-color: #5B8AAE;
}

.photo-checkbox input[type="checkbox"]:checked + label::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Empty Gallery */
.empty-gallery {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-gallery h3 {
    color: #5B8AAE;
    margin-bottom: 1rem;
}

.empty-gallery p {
    color: #666;
    margin-bottom: 2rem;
}

/* Upload Section */
.upload-section {
    background: #f8f9fa;
    padding: 4rem 0;
    margin-top: 3rem;
}

.upload-intro {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
    color: #666;
}

.upload-form {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #5B8AAE;
}

.file-upload-area {
    position: relative;
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #5B8AAE;
    background: #f8fbfd;
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.upload-placeholder p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.upload-placeholder small {
    color: #666;
}

.file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,0,0,0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
}

.upload-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #5B8AAE, #7BA9C7);
    width: 0%;
    transition: width 0.3s ease;
}

/* Lightbox */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0,0,0,0.9);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.7);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: background 0.3s ease;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: rgba(0,0,0,0.9);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 80px 20px 20px;
}

.lightbox-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.lightbox-info {
    background: rgba(0,0,0,0.8);
    color: white;
    width: 100%;
    padding: 1rem;
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    backdrop-filter: blur(10px);
}

.lightbox-info h3 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.lightbox-info p {
    margin-bottom: 0.25rem;
    opacity: 0.9;
    font-size: 0.9rem;
}

.lightbox-info .btn {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #5B8AAE;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
}

.btn:hover {
    background: #4A7496;
    transform: translateY(-2px);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    color: #5B8AAE;
    border: 2px solid #5B8AAE;
}

.btn-outline:hover {
    background: #5B8AAE;
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

/* Messages */
.message-container {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 1500;
}

.message {
    background: white;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #5B8AAE;
    animation: slideInRight 0.3s ease;
}

.message.success {
    border-left-color: #28a745;
}

.message.error {
    border-left-color: #dc3545;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        padding: 1rem;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .gallery-hero h1 {
        font-size: 2.5rem;
    }
    
    .gallery-stats {
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .category-card {
        padding: 1.5rem;
    }
    
    .gallery-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .photo-grid.masonry {
        columns: 2;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .upload-form {
        padding: 2rem;
    }
    
    /* Mobile Lightbox Optimizations */
    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav {
        font-size: 1.5rem;
        width: 50px;
        height: 50px;
        padding: 0.5rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-image-container {
        padding: 60px 10px 100px;
    }
    
    .lightbox-info {
        padding: 0.75rem;
    }
    
    .lightbox-info h3 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .lightbox-info p {
        font-size: 0.8rem;
        margin-bottom: 0.15rem;
    }
    
    .lightbox-info .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        margin-top: 0.25rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 1rem;
    }
    
    .gallery-hero {
        margin-top: 70px;
    }
    
    .gallery-hero .hero-content {
        padding: 2rem 1rem;
    }
    
    .gallery-hero h1 {
        font-size: 2rem;
    }
    
    .gallery-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .photo-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .photo-grid.masonry {
        columns: 1;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    /* Full-screen mobile lightbox */
    .lightbox-content {
        max-width: 100vw;
        max-height: 100vh;
    }
    
    .lightbox-close {
        top: 5px;
        right: 5px;
        font-size: 1.2rem;
        width: 35px;
        height: 35px;
        background: rgba(0,0,0,0.8);
    }
    
    .lightbox-nav {
        font-size: 1.2rem;
        width: 45px;
        height: 45px;
        background: rgba(0,0,0,0.8);
    }
    
    .lightbox-prev {
        left: 5px;
    }
    
    .lightbox-next {
        right: 5px;
    }
    
    .lightbox-image-container {
        padding: 50px 5px 80px;
    }
    
    .lightbox-main img {
        border-radius: 0;
    }
    
    .lightbox-info {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .lightbox-info h3 {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }
    
    .lightbox-info p {
        font-size: 0.7rem;
        margin-bottom: 0.1rem;
    }
    
    .lightbox-info .btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        margin-top: 0.2rem;
    }
    
    /* Hide info panel completely on very small screens */
    .lightbox-info-toggle {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.8);
        color: white;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.8rem;
        z-index: 15;
    }
    
    .lightbox-info.hidden {
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
}

/* Animation for photo loading */
.photo-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.photo-item:nth-child(even) {
    animation-delay: 0.1s;
}

.photo-item:nth-child(3n) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #5B8AAE;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
}

.scroll-to-top:hover {
    background: #4A7496;
    transform: translateY(-2px);
}

/* Media query specifica per smartphone - Ottimizzazioni avanzate */
@media (max-width: 576px) {
    /* Navbar mobile ottimizzata */
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    .nav-logo {
        font-size: 1.5rem;
    }
    
    .nav-toggle span {
        width: 20px;
        height: 2px;
    }
    
    .nav-menu {
        gap: 0;
        padding: 0.5rem;
    }
    
    .nav-menu a {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #f0f0f0;
        display: block;
        text-align: center;
    }
    
    .nav-menu a:last-child {
        border-bottom: none;
    }
    
    /* Hero ottimizzato per smartphone */
    .gallery-hero {
        min-height: 50vh;
        margin-top: 65px;
    }
    
    .gallery-hero .hero-content {
        padding: 1.5rem 1rem;
    }
    
    .gallery-hero h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .gallery-hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Stats sempre in linea per smartphone */
    .gallery-stats {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-top: 1.5rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 1rem;
    }
    
    .stat-item {
        text-align: center;
        min-width: 80px;
        flex-shrink: 0;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Category cards ottimizzate */
    .category-filter {
        margin-bottom: 2rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .category-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .category-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    .photo-count {
        font-size: 0.8rem;
    }
    
    /* Gallery actions compatte */
    .gallery-actions {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .view-options {
        justify-content: center;
        gap: 0.25rem;
    }
    
    .view-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .download-options {
        justify-content: center;
        gap: 0.5rem;
    }
    
    /* Photo grid ottimizzata per smartphone */
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .photo-grid.masonry {
        columns: 2;
        column-gap: 0.5rem;
    }
    
    .photo-grid.masonry .photo-item {
        margin-bottom: 0.5rem;
    }
    
    .photo-container {
        height: 200px;
    }
    
    /* Photo overlay ottimizzato per touch */
    .photo-overlay {
        opacity: 0.3;
        background: linear-gradient(
            to bottom,
            rgba(0,0,0,0) 0%,
            rgba(0,0,0,0.2) 50%,
            rgba(0,0,0,0.9) 100%
        );
    }
    
    .photo-item:hover .photo-overlay,
    .photo-item:active .photo-overlay {
        opacity: 1;
    }
    
    .photo-actions {
        gap: 0.25rem;
    }
    
    .action-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .photo-info h4 {
        font-size: 0.85rem;
        margin-bottom: 0.1rem;
    }
    
    .photo-category,
    .photo-date {
        font-size: 0.7rem;
        margin-bottom: 0.1rem;
    }
    
    /* Upload form mobile */
    .upload-section {
        padding: 2rem 0;
        margin-top: 2rem;
    }
    
    .upload-form {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .file-upload-area {
        padding: 1.5rem;
    }
    
    .upload-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .upload-placeholder p {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .upload-placeholder small {
        font-size: 0.8rem;
    }
    
    .file-preview {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .preview-item img {
        height: 80px;
    }
    
    /* Lightbox mobile ottimizzato */
    .lightbox-content {
        max-width: 100vw;
        max-height: 100vh;
        padding: 0;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        background: rgba(0,0,0,0.7);
    }
    
    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        background: rgba(0,0,0,0.7);
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-image-container {
        padding: 60px 10px 120px;
    }
    
    .lightbox-info {
        padding: 1rem;
        transform: translateY(0);
        transition: transform 0.3s ease;
    }
    
    .lightbox-info.hidden {
        transform: translateY(100%);
    }
    
    .lightbox-info h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .lightbox-info p {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }
    
    /* Pulsanti ottimizzati per touch */
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-sm {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    /* Scroll to top mobile */
    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
    
    /* Messages mobile */
    .message-container {
        top: 80px;
        right: 0.5rem;
        left: 0.5rem;
    }
    
    .message {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Container padding ottimizzato */
    .container {
        padding: 0 0.75rem;
    }
    
    /* Section padding ridotto */
    section {
        padding: 1.5rem 0;
    }
    
    /* Empty gallery mobile */
    .empty-gallery {
        padding: 2rem 1rem;
        margin: 0 0.5rem;
    }
    
    .empty-icon {
        font-size: 3rem;
        margin-bottom: 0.5rem;
    }
    
    .empty-gallery h3 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }
    
    .empty-gallery p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
}
