/* Photos Page Styles */

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    margin: 0;
    color: var(--primary-color);
    font-size: 2.2rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    color: white;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-section label {
    font-weight: 600;
    color: var(--primary-color);
}

.filter-section select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: white;
    color: var(--text-color);
    font-size: 1rem;
    min-width: 200px;
}

.filter-section select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--background-color);
    padding: 0.25rem;
    border-radius: 6px;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.view-btn.active,
.view-btn:hover {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Albums Section */
.albums-section {
    margin: 3rem 0;
}

.albums-section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.album-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.album-cover {
    width: 100%;
    height: 150px;
    overflow: hidden;
    position: relative;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.album-card:hover .album-cover img {
    transform: scale(1.05);
}

.album-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    font-size: 3rem;
    color: var(--border-color);
}

.album-info {
    padding: 1rem;
}

.album-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.album-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.view-all-albums {
    text-align: center;
    margin-top: 1rem;
}

/* Photos Section */
.photos-section {
    margin: 3rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.photo-count {
    color: #666;
    font-weight: normal;
    font-size: 1.2rem;
}

/* Photos Grid View */
.photos-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.grid-view .photo-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-view .photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.grid-view .photo-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.grid-view .photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grid-view .photo-item:hover .photo-thumbnail img {
    transform: scale(1.05);
}

.grid-view .photo-info {
    padding: 1rem;
}

/* Photos List View */
.photos-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-view .photo-item {
    display: flex;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.list-view .photo-item:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.list-view .photo-thumbnail {
    width: 150px;
    height: 120px;
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
}

.list-view .photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-view .photo-info {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Photo Info Common Styles */
.photo-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.photo-date {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 0.75rem 0;
}

.photo-tags-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tagged-people {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tagged-person {
    background: var(--background-color);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.tagged-person:hover {
    background: var(--primary-color);
    color: white;
}

.more-tags {
    background: var(--border-color);
    color: #666;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.photo-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.action-btn {
    background: var(--background-color);
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.action-btn:hover {
    background: var(--border-color);
}

/* No Photos State */
.no-photos {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.no-photos-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-photos h2 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
}

.no-photos p {
    margin: 0 0 2rem 0;
    color: #666;
    font-size: 1.1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0 2rem 0;
}

.pagination-btn {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: var(--background-color);
}

.modal form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    display: flex;
    max-width: 95vw;
    max-height: 95vh;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-image-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-tags {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.lightbox-tag {
    position: absolute;
    border: 2px solid var(--accent-color);
    background: rgba(231, 76, 60, 0.2);
    pointer-events: auto;
}

.lightbox-tag-label {
    position: absolute;
    bottom: -30px;
    left: 0;
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    white-space: nowrap;
    font-weight: 600;
}

.lightbox-info {
    width: 300px;
    padding: 2rem;
    background: white;
    overflow-y: auto;
}

.lightbox-info h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.lightbox-info p {
    margin: 0 0 1.5rem 0;
    color: #666;
    line-height: 1.6;
}

.lightbox-meta {
    margin-bottom: 1.5rem;
}

.lightbox-meta-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.lightbox-meta-label {
    font-weight: 600;
    color: var(--primary-color);
}

.lightbox-tagged-people h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.lightbox-tagged-person {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--background-color);
    border-radius: 6px;
}

.lightbox-tagged-person a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.lightbox-tagged-person a:hover {
    color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-section {
        justify-content: center;
    }
    
    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .photos-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .list-view .photo-item {
        flex-direction: column;
    }
    
    .list-view .photo-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .lightbox-content {
        flex-direction: column;
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .lightbox-info {
        width: 100%;
        max-height: 40vh;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal form {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .photos-container.grid-view {
        grid-template-columns: 1fr;
    }
    
    .albums-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-bar {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* Person Selector Styles */
.person-selector {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: #f9f9f9;
    padding: 1rem;
}

.person-search-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.person-search-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.9rem;
}

.person-search-input button {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.person-search-input button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.person-search-input button:not(:disabled):hover {
    background: var(--secondary-color);
}

.person-suggestions {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.person-suggestion {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.person-suggestion:last-child {
    border-bottom: none;
}

.person-suggestion:hover {
    background: #f0f8ff;
}

.person-suggestion.selected {
    background: var(--primary-color);
    color: white;
}

.suggestion-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.suggestion-details {
    font-size: 0.8rem;
    color: #666;
}

.person-suggestion.selected .suggestion-details {
    color: rgba(255,255,255,0.8);
}

.selected-people {
    min-height: 40px;
}

.no-people-message {
    color: #666;
    font-style: italic;
    margin: 0;
    text-align: center;
    padding: 1rem 0;
}

.selected-person {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 6px 10px;
    border-radius: 20px;
    margin: 4px;
    font-size: 0.85rem;
}

.selected-person .person-name {
    font-weight: 500;
}

.selected-person .person-details {
    opacity: 0.8;
    font-size: 0.75rem;
}

.selected-person .remove-person {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    padding: 0;
    line-height: 1;
}

.selected-person .remove-person:hover {
    background: rgba(255,255,255,0.3);
}