/* Familien Foto-Galerie - Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Breadcrumb */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Folder Grid */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.folder-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
}

.folder-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.folder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.folder-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Video Toggle Button */
.video-toggle {
    display: inline-block;
    margin: 1rem 0;
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.video-toggle:hover {
    background: #5568d3;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: #e0e0e0;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-item {
    position: relative;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 6px;
    text-decoration: none;
    color: #667eea;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #667eea;
    color: white;
}

.pagination .current {
    background: #667eea;
    color: white;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    padding: 1rem;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.lightbox video {
    max-width: 95%;
    max-height: 95%;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
}

.lightbox.hide-controls .lightbox-close {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: white;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
}

.lightbox.hide-controls .lightbox-nav {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

/* Delete Button */
.delete-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    border: 2px solid white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 11;
}

.delete-btn:hover {
    background: rgba(255, 59, 48, 1);
    transform: scale(1.05);
}

.lightbox.hide-controls .delete-btn {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

/* Slideshow Controls */
.slideshow-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    background: rgba(0,0,0,0.7);
    padding: 1rem;
    border-radius: 12px;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
}

.lightbox.hide-controls .slideshow-controls {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

.slideshow-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.slideshow-btn:hover {
    background: rgba(255,255,255,0.3);
}

.slideshow-speed {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.slideshow-speed input {
    width: 100px;
}

/* Video Loading */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
    text-align: center;
    background: rgba(0,0,0,0.7);
    padding: 2rem;
    border-radius: 12px;
    z-index: 10;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Confirm Dialog */
.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 1001;
    max-width: 400px;
    width: 90%;
}

.confirm-dialog h3 {
    margin-bottom: 1rem;
    color: #333;
}

.confirm-dialog p {
    margin-bottom: 1.5rem;
    color: #666;
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.confirm-buttons button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.confirm-yes {
    background: #ff3b30;
    color: white;
}

.confirm-yes:hover {
    background: #e02b20;
}

.confirm-no {
    background: #e0e0e0;
    color: #333;
}

.confirm-no:hover {
    background: #d0d0d0;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    z-index: 1002;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Info Text */
.info-text {
    text-align: center;
    color: #666;
    margin: 2rem 0;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Login Page */
.login-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 90%;
}

.login-box h1 {
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.login-box input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.login-box button {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.login-box button:hover {
    background: #5568d3;
}

body:has(.login-box) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}