/* Reset & Variables */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Universele afbeelding orientatie correctie */
img {
    image-orientation: from-image;
    transform-origin: center center;
}

:root {
    --primary: #667eea;
    --accent: #4facfe;
    --success: #48bb78;
    --danger: #f56565;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.text-red { color: var(--danger); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    padding: 3rem 0;
    text-align: center;
    color: var(--white);
}

.main-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.main-title i { 
    margin-right: 0.75rem;
    color: #f093fb;
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* Upload Section */
.upload-section { 
    padding: 2rem 0;
    margin-bottom: 3rem;
}

.upload-card {
    background: var(--white);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
    padding: 1.5rem 2rem;
    text-align: center;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-header i { margin-right: 0.5rem; }

.upload-form {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.upload-form > * {
    width: 100%;
    box-sizing: border-box;
}

/* File Input */
.file-input-wrapper { 
    position: relative; 
    width: 100%;
}

.textarea-wrapper {
    width: 100%;
}

.file-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    border: 2px dashed var(--gray-300);
    border-radius: 1rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--gray-50);
    text-align: center;
    padding: 2rem;
}

.file-label:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.file-label.file-selected {
    border-color: var(--success);
    background: rgba(72, 187, 120, 0.05);
}

.file-label i {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.file-label:hover i {
    color: var(--primary);
    transform: scale(1.1);
}

.file-label span {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.file-label small {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Textarea */
.description-input {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
    background: var(--white);
}

.description-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Upload Button */
.upload-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.upload-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.fa-spinner { animation: spin 1s linear infinite; }

/* Gallery Section */
.gallery-section {
    background: var(--white);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    margin-bottom: 3rem;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.gallery-header h2 {
    font-size: 1.5rem;
    color: var(--gray-800);
    font-weight: 600;
}

.gallery-header i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.photo-count {
    background: var(--primary);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Gallery Preview */
.gallery-preview { margin-top: 2rem; }

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.preview-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 280px; /* Kleiner voor compactere weergave */
}

.preview-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.preview-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: center;
    background: #f8f9fa;
    transition: transform 0.4s ease;
    image-orientation: from-image;
    transform-origin: center center;
}

/* Alternatieve foto container voor betere aspect ratio */
.photo-container-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-container-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.preview-card:hover img {
    transform: scale(1.1);
}

.preview-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.preview-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
}

.preview-info p {
    margin: 0;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    line-height: 1.4;
}

.gallery-actions {
    text-align: center;
    margin-top: 2rem;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.3);
}

.view-all-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.4);
    text-decoration: none;
    color: white;
}

.btn-arrow { transition: transform 0.3s ease; }
.view-all-btn:hover .btn-arrow { transform: translateX(5px); }

/* No Photos */
.no-photos {
    text-align: center;
    padding: 4rem 2rem;
}

.no-photos-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.no-photos i {
    font-size: 4rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1rem;
}

.no-photos h3 {
    color: var(--white);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.no-photos p {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--white);
    opacity: 0.8;
}

.footer-content p { font-size: 0.875rem; }

/* Gallery Viewer */
.gallery-viewer {
    min-height: 100vh;
    background: var(--gray-900);
    color: var(--white);
    display: flex;
    flex-direction: column;
}

.gallery-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

.gallery-counter {
    font-weight: 500;
    color: #d1d5db;
}

.photo-viewer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.photo-container {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.photo-main {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.main-photo {
    width: 100%;
    height: auto;
    max-height: 60vh;
    max-width: 100%;
    object-fit: contain;
    display: block;
    background: var(--white);
    image-orientation: from-image;
    transform-origin: center center;
}

.photo-info {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    backdrop-filter: blur(10px);
}

.photo-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.photo-description p {
    font-size: 1rem;
    line-height: 1.6;
    color: #d1d5db;
    margin-bottom: 2rem;
}

.no-description {
    font-style: italic;
    color: #9ca3af;
}

.photo-meta {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.upload-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.5rem;
    transition: var(--transition);
    z-index: 10;
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
    color: var(--white);
}

.nav-left { left: 2rem; }
.nav-right { right: 2rem; }

.thumbnail-strip {
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.thumbnails {
    display: flex;
    gap: 1rem;
    padding: 0 2rem;
    overflow-x: auto;
}

.thumbnail {
    flex: 0 0 80px;
    height: 80px;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--transition);
    display: block;
}

.thumbnail:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: var(--primary);
    transform: scale(1.1);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8f9fa;
    image-orientation: from-image;
    transform-origin: center center;
}

/* Photo Actions */
.photo-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.photo-main:hover .photo-actions {
    opacity: 1;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.edit-btn {
    background: rgba(102, 126, 234, 0.9);
    color: var(--white);
}

.edit-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    color: var(--white);
    text-decoration: none;
}

.delete-btn {
    background: rgba(245, 101, 101, 0.9);
    color: var(--white);
}

.delete-btn:hover {
    background: var(--danger);
    transform: translateY(-2px);
    color: var(--white);
    text-decoration: none;
}

/* Edit Page Styling */
.edit-preview {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
}

.edit-photo {
    display: inline-block;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    max-width: 400px;
}

.preview-image {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    display: block;
    background: #f8f9fa;
    image-orientation: from-image;
    transform-origin: center center;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.form-label i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cancel-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--gray-300);
    color: var(--gray-800);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.cancel-btn:hover {
    background: var(--gray-600);
    color: var(--white);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Success Messages */
.success-message {
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.8);
}

.alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: var(--success);
    color: var(--white);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Fullscreen Carousel */
.fullscreen-carousel {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.carousel-main {
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 200px);
}

.carousel-images {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.photo-slide {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.photo-slide .photo-container {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.photo-slide .main-photo {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
}

.photo-details {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

.photo-details h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.photo-details p {
    font-size: 1rem;
    line-height: 1.6;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.photo-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
    z-index: 10;
}

.fullscreen-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.fullscreen-nav.prev { left: 2rem; }
.fullscreen-nav.next { right: 2rem; }

/* Mobile */
@media (max-width: 768px) {
    .main-title { font-size: 1.875rem; }
    .photo-slide .photo-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    .gallery-nav { padding: 1rem; }
    .photo-slide { padding: 1rem; }
    .fullscreen-nav {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    .fullscreen-nav.prev { left: 1rem; }
    .fullscreen-nav.next { right: 1rem; }
    .thumbnail { flex: 0 0 60px; height: 60px; }
    .preview-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }
    .preview-card img { height: 140px; }
    .preview-card { height: 240px; }
    .preview-info { padding: 0.75rem; }
    .view-all-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container { padding: 0 0.75rem; }
    .upload-card, .gallery-section {
        margin: 0 -0.75rem;
        border-radius: 0;
    }
    .file-label {
        min-height: 120px;
        padding: 1.5rem;
    }
    .thumbnails { padding: 0 1rem; }
    .photo-info { padding: 1.5rem; }
}
