/* Photo Gallery Styles */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.page-header h2 {
    margin: 0;
    color: #333;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.gallery-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(102, 126, 234, 0.3);
}

.gallery-cover {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #f0f0f0;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.photo-count {
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.gallery-info {
    padding: 20px;
}

.gallery-info h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.gallery-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    font-size: 18px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.page-info {
    color: #666;
    font-size: 16px;
}

/* Management Page */
.management-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.management-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.file-input-wrapper {
    position: relative;
}

.file-input-info {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Photo Upload Area */
.upload-area {
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: background 0.3s ease;
}

.upload-area:hover {
    background: #f0f2ff;
}

.upload-area.drag-over {
    background: #e8ebff;
    border-color: #4c5fd5;
}

/* Photo Grid for Management */
.photo-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.photo-item {
    position: relative;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    cursor: move;
    cursor: grab;
    transition: transform 0.2s ease;
}

.photo-item:active {
    cursor: grabbing;
}

.photo-item:hover {
    transform: scale(1.05);
}

.photo-item.dragging {
    opacity: 0.5;
    transform: rotate(3deg) scale(1.05);
    z-index: 1000;
}

.photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.photo-item-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
}

.photo-item-actions button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.photo-item-actions button:hover {
    background: white;
}

.photo-item-order {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.cover-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.photo-item.cover-photo {
    border: 3px solid #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Music List Styles */
.music-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.music-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: move;
    transition: all 0.2s ease;
}

.music-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.music-item.dragging {
    opacity: 0.5;
}

.music-item-order {
    background: #667eea;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    min-width: 35px;
    text-align: center;
}

.music-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Slideshow Styles */
.slideshow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    z-index: 9999;
}

.slideshow-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slideshow-image.active {
    opacity: 1;
}

.slideshow-image.fade-out {
    opacity: 0;
}

.slideshow-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    gap: 10px;
}

.slideshow-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s ease;
}

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

.slideshow-info {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    color: white;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 6px;
}

.slideshow-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.slideshow-counter {
    font-size: 14px;
    opacity: 0.8;
}

/* Gallery List for Management */
.gallery-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gallery-list-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: box-shadow 0.2s ease;
    cursor: move;
}

.gallery-list-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.gallery-list-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.gallery-drag-handle {
    font-size: 20px;
    color: #999;
    cursor: grab;
    user-select: none;
    padding: 0 5px;
}

.gallery-drag-handle:active {
    cursor: grabbing;
}

.gallery-list-thumb {
    width: 80px;
    height: 80px;
    min-width: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
}

.gallery-list-thumb-empty {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-list-info {
    flex: 1;
}

.gallery-list-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.gallery-list-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.gallery-list-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #5568d3;
}

.btn-primary {
    background: #667eea;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert Messages */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .photo-management-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .slideshow-controls {
        top: 10px;
        right: 10px;
    }
    
    .slideshow-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}

