/* CSS per pagina singolo luogo */

.place-main {
    padding-top: 2rem;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #e74c3c;
}

.separator {
    color: #ccc;
}

.current {
    color: #2c3e50;
    font-weight: 600;
}

/* Header del luogo */
.place-header {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.place-title-section h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.place-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.place-meta > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.place-meta i {
    color: #e74c3c;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rating i {
    color: #ddd;
    font-size: 0.9rem;
}

.rating i.active {
    color: #f39c12;
}

.rating-text {
    margin-left: 0.5rem;
    color: #666;
    font-weight: 500;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #e74c3c;
}

.author-info .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.author-details .author-name {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.publish-date {
    color: #666;
    font-size: 0.9rem;
}

.place-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 120px;
}

.btn-action:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.2);
}

.like-btn.liked {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.like-btn.liked:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: white;
}

.btn-action.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.back-btn {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.back-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
    color: white;
}

.edit-btn {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.edit-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
    color: white;
}

/* Galleria foto */
.photo-gallery {
    margin-bottom: 2rem;
}

.main-photo {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.main-photo img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.main-photo:hover img {
    transform: scale(1.02);
}

.photo-counter {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.photo-thumbnails {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.photo-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.photo-thumbnails::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.photo-thumbnails::-webkit-scrollbar-thumb {
    background: #e74c3c;
    border-radius: 3px;
}

.thumbnail {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border: 3px solid transparent;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #e74c3c;
    transform: translateY(-2px);
}

/* Layout dettagli */
.place-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Colonna principale */
.main-column > section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #f8f9fa;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.section-header h2 {
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
}

.section-header h2 i {
    color: #e74c3c;
}

.count {
    color: #666;
    font-weight: normal;
    font-size: 0.9rem;
}

.description-section h2 {
    padding: 1.5rem 2rem;
    margin: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #f8f9fa;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
}

.description-section h2 i {
    color: #e74c3c;
}

.description-content {
    padding: 2rem;
    line-height: 1.8;
    font-size: 1.05rem;
    color: #555;
}

/* Form recensioni */
.add-review-form {
    padding: 2rem;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.add-review-form h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.rating-input {
    margin-bottom: 1rem;
}

.rating-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.star-rating {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.star-rating i {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.3s ease;
}

.star-rating i:hover,
.star-rating i.active {
    color: #f39c12;
}

.add-review-form textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.add-review-form textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Lista recensioni */
.reviews-list,
.comments-list {
    padding: 0 2rem 2rem;
}

.review-item,
.comment {
    padding: 1.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.review-item:last-child,
.comment:last-child {
    border-bottom: none;
}

.review-header,
.comment-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.review-header .avatar,
.comment .avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.review-author,
.comment-content {
    flex: 1;
}

.review-author .name,
.comment-author {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.review-author .date,
.comment-time {
    color: #999;
    font-size: 0.85rem;
}

.review-author .rating {
    margin: 0.25rem 0;
}

.review-content,
.comment-text {
    line-height: 1.6;
    color: #555;
    margin-top: 0.5rem;
}

/* Form commenti */
.add-comment {
    padding: 2rem;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.comment-input {
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: white;
    border-radius: 25px;
    padding: 0.5rem;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.comment-input:focus-within {
    border-color: #e74c3c;
}

.comment-text {
    flex: 1;
    border: none;
    background: none;
    padding: 0.75rem 1rem;
    resize: none;
    outline: none;
    max-height: 100px;
    min-height: 40px;
    font-family: inherit;
    font-size: 0.95rem;
}

.btn-comment-submit {
    background: #e74c3c;
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.btn-comment-submit:hover {
    background: #c0392b;
}

/* Stati vuoti */
.no-reviews,
.no-comments {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-reviews i,
.no-comments i {
    color: #ddd;
    margin-bottom: 1rem;
}

.no-reviews h3,
.no-comments h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.sidebar-section h3 {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section .content {
    padding: 1.5rem;
}

/* Mappa */
.place-map {
    width: 100%;
    height: 250px;
    margin-bottom: 1rem;
}

.coordinates {
    text-align: center;
    margin-bottom: 1rem;
    color: #666;
    font-family: monospace;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Statistiche luogo */
.place-stats {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: #666;
}

.stat:last-child {
    margin-bottom: 0;
}

.stat i {
    width: 20px;
    color: #e74c3c;
}

.place-info {
    padding: 1.5rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

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

.label {
    color: #666;
    font-weight: 500;
}

.value {
    color: #2c3e50;
    font-weight: 600;
}

/* Luoghi correlati */
.related-places {
    padding: 1.5rem;
}

.related-place {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.3s ease;
    margin-bottom: 1rem;
}

.related-place:hover {
    background: #f8f9fa;
}

.related-place:last-child {
    margin-bottom: 0;
}

.related-place img,
.related-place .no-image {
    width: 60px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.related-place .no-image {
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

.related-place .place-info {
    flex: 1;
    padding: 0;
}

.related-place h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 600;
    line-height: 1.3;
}

.related-place .location {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.related-place .rating {
    margin: 0;
}

.related-place .rating i {
    font-size: 0.75rem;
}

/* Modal foto */
.photo-modal {
    background: rgba(0,0,0,0.95);
}

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

.photo-modal-content .close-modal {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
}

.prev-btn {
    left: 2rem;
}

.next-btn {
    right: 2rem;
}

#modalPhoto {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.photo-modal .photo-info {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .place-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sidebar {
        order: -1;
    }
    
    .sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .place-header {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .place-title-section h1 {
        font-size: 2rem;
    }
    
    .place-actions {
        flex-direction: row;
        width: 100%;
    }
    
    .btn-action {
        flex: 1;
        min-width: auto;
    }
    
    .main-photo img {
        height: 300px;
    }
    
    .photo-thumbnails {
        gap: 0.5rem;
    }
    
    .thumbnail {
        width: 80px;
        height: 60px;
    }
    
    .place-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .reviews-list,
    .comments-list,
    .description-content,
    .add-review-form,
    .add-comment {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .place-header {
        padding: 1.5rem;
    }
    
    .nav-btn {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .prev-btn {
        left: 1rem;
    }
    
    .next-btn {
        right: 1rem;
    }
    
    .photo-modal-content .close-modal {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .place-main {
        padding-top: 1rem;
    }
    
    .breadcrumb {
        margin: 0 -1rem 1rem -1rem;
        border-radius: 0;
        padding: 0.75rem 1rem;
    }
    
    .place-title-section h1 {
        font-size: 1.8rem;
    }
    
    .author-info {
        padding: 1rem;
        margin: 0 -0.5rem;
    }
    
    .main-photo img {
        height: 250px;
    }
    
    .photo-counter {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .thumbnail {
        width: 70px;
        height: 50px;
    }
    
    .place-details {
        gap: 0.5rem;
    }
    
    .main-column > section,
    .sidebar-section {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }
    
    .add-comment {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .comment-input {
        border-radius: 12px;
    }
    
    .btn-comment-submit {
        align-self: flex-end;
        border-radius: 12px;
        width: auto;
        padding: 0.75rem 1.5rem;
    }
    
    .related-place {
        padding: 0.75rem;
    }
    
    .related-place img,
    .related-place .no-image {
        width: 50px;
        height: 40px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animazioni */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.place-header,
.photo-gallery,
.main-column > section,
.sidebar-section {
    animation: fadeInUp 0.6s ease-out;
}

.main-column > section:nth-child(2) {
    animation-delay: 0.1s;
}

.main-column > section:nth-child(3) {
    animation-delay: 0.2s;
}

.sidebar-section:nth-child(1) {
    animation-delay: 0.1s;
}

.sidebar-section:nth-child(2) {
    animation-delay: 0.2s;
}

.sidebar-section:nth-child(3) {
    animation-delay: 0.3s;
}

/* Like animation */
.like-btn.liked i {
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.15);
    }
}

/* Hover effects */
.review-item:hover,
.comment:hover {
    background: rgba(231, 76, 60, 0.02);
    border-radius: 8px;
    margin: 0 -1rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

.related-place:hover {
    transform: translateX(5px);
}

/* Focus states per accessibilità */
.btn-action:focus,
.thumbnail:focus,
.comment-text:focus,
.star-rating i:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

/* Smooth scrolling per anchor links */
html {
    scroll-behavior: smooth;
}

/* Loading states */
.btn-action.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-action.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Print styles */
@media print {
    .place-header .place-actions,
    .nav-btn,
    .photo-modal,
    .main-footer,
    .main-header,
    .breadcrumb,
    .add-comment,
    .add-review-form {
        display: none !important;
    }
    
    .place-details {
        grid-template-columns: 1fr;
    }
    
    .main-photo img {
        height: auto;
        max-height: 400px;
    }
    
    .photo-thumbnails {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .place-header,
    .main-column > section,
    .sidebar-section {
        border: 2px solid;
    }
    
    .btn-action {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .main-photo:hover img {
        transform: none;
    }
    
    .thumbnail:hover {
        transform: none;
    }
}

/* Dark mode support (se implementato) */
@media (prefers-color-scheme: dark) {
    .place-header,
    .main-column > section,
    .sidebar-section {
        background: #2c3e50;
        color: white;
    }
    
    .section-header {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    }
    
    .breadcrumb {
        background: #2c3e50;
    }
    
    .breadcrumb a {
        color: #bdc3c7;
    }
    
    .breadcrumb a:hover {
        color: #e74c3c;
    }
    
    .current {
        color: white;
    }
    
    .add-comment,
    .add-review-form {
        background: #34495e;
    }
    
    .comment-input,
    .add-review-form textarea {
        background: #2c3e50;
        border-color: #4a5f7a;
        color: white;
    }
}