/* Global Styles */
body {
    background-color: #f7f9fc;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Hero Section */
.hero {
    background: #ffffff;
    padding: 100px 20px 60px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 3em;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.2em;
    color: #7f8c8d;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Container */
.container {
    flex: 1;
    padding: 0 40px 60px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

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

/* Card Style */
.gallery-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.02);
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.1);
}

.gallery-item a {
    display: block;
    height: 0;
    padding-bottom: 66.66%; /* 3:2 Aspect Ratio */
    position: relative;
    overflow: hidden;
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

/* Pagination */
.pagination {
    margin-top: 80px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    border-radius: 8px;
    background: #ffffff;
    color: #95a5a6;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
}

.pagination a:hover {
    color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
}

.pagination .current {
    background: #2c3e50;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(44, 62, 80, 0.3);
}

/* Footer */
.footer {
    background: #ffffff;
    color: #bdc3c7;
    text-align: center;
    padding: 40px;
    font-size: 0.9em;
    border-top: 1px solid #f0f0f0;
}

.footer a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: #3498db;
}

.footer-stats {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    color: #7f8c8d;
    margin-bottom: 12px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.guest-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px 60px;
    gap: 16px;
}

.guest-card {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
}

.guest-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.guest-subtitle {
    color: #7f8c8d;
    font-size: 13px;
    margin-bottom: 16px;
}

.guest-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.guest-card {
    width: 100%;
    max-width: 660px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
    padding: 36px;
    margin: 28px auto;
}

.guest-header {
    text-align: center;
    margin-bottom: 24px;
}

.guest-title {
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.guest-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
}

.guest-steps {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin: 16px 0 6px;
    position: relative;
    flex-wrap: wrap;
}

.guest-step {
    position: relative;
    text-align: center;
    font-weight: 500;
    color: #9ca3af;
    font-size: 13px;
    padding-top: 30px;
    min-width: 110px;
}

.guest-step::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.guest-step-active {
    color: #2563eb;
}

.guest-step-active::before {
    background: #93c5fd;
}

.guest-step-done {
    color: #16a34a;
}

.guest-step-done::before {
    background: #86efac;
}

.guest-alerts {
    margin-bottom: 18px;
}

.guest-alert {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.guest-alert + .guest-alert {
    margin-top: 8px;
}

.guest-alert-error {
    background: #fef2f2;
    color: #b91c1c;
}

.guest-alert-success {
    background: #ecfdf3;
    color: #15803d;
}

.guest-alert-id {
    text-align: center;
    color: #7c3aed;
    font-size: 12px;
    margin-top: 6px;
}

.guest-section {
    background: #f9fafb;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
}

.guest-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    text-align: center;
}

.guest-form {
    margin-bottom: 12px;
}

.guest-form-row {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.guest-field {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.guest-label {
    font-size: 13px;
    color: #6b7280;
}

.guest-input {
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.guest-input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.guest-field-hint {
    font-size: 12px;
    color: #9ca3af;
}

.guest-field-hint-error {
    color: #dc2626;
}

.guest-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px dashed #cbd5f5;
    border-radius: 12px;
    background: #f8fafc;
}

.guest-file-input {
    flex: 0 0 auto;
    max-width: 220px;
}

.guest-file-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.guest-file-name {
    font-size: 13px;
    color: #1f2937;
    word-break: break-all;
}

.guest-file-size {
    font-size: 12px;
    color: #9ca3af;
}

.guest-actions {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.guest-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.guest-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.25);
}

.guest-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: none;
}

.guest-btn-secondary {
    background: #0ea5e9;
}

.guest-btn-secondary:hover {
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.25);
}

.guest-meta {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    flex-wrap: wrap;
}

.guest-meta div {
    background: #f3f4f6;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
}

.guest-verified-card {
    display: flex;
    align-items: center;
    background: #f0f7ff;
    border: 1px solid #cce5ff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.guest-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.guest-info {
    flex: 1;
}

.guest-nickname {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 2px;
}

.guest-email {
    color: #666;
    font-size: 13px;
}

.guest-status {
    color: #2ecc71;
    font-size: 12px;
    background: #eafaf1;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}

.guest-hint {
    text-align: center;
    color: #ef4444;
    background: #fff1f2;
    padding: 14px;
    border-radius: 12px;
    margin: 18px auto;
    max-width: 520px;
    border: 1px solid #fecdd3;
}

.upload-status {
    text-align: center;
    font-size: 13px;
    color: #4b5563;
    margin-top: 10px;
}

.rename-prompt {
    background: linear-gradient(135deg, #fff5f5 0%, #fffbf5 100%);
    border: 2px solid #ff9800;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    animation: fadeIn 0.5s ease;
}

.rename-prompt-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #e65100;
    margin-bottom: 15px;
    font-size: 16px;
}

.rename-icon {
    color: #ff9800;
}

.rename-prompt-content {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.rename-example {
    background: #fff;
    border: 1px solid #4CAF50;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    position: relative;
}

.rename-badge {
    position: absolute;
    top: -8px;
    left: 10px;
    background: #4CAF50;
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.rename-tips {
    margin: 15px 0;
}

.rename-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    color: #4CAF50;
}

.guest-back {
    text-align: center;
    margin-top: 10px;
}

.guest-back-link {
    display: inline-block;
    padding: 12px 32px;
    background: #6b7280;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
}

.guest-back-link:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.is-hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .guest-card {
        padding: 24px 18px;
        margin: 16px;
    }
    
    .guest-steps {
        gap: 16px;
    }
    
    .guest-form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .guest-file-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .guest-actions {
        justify-content: stretch;
    }
    
    .guest-btn {
        width: 100%;
    }
    
    .guest-meta {
        flex-direction: column;
    }
}

/* Admin / Upload Page */
.admin-container {
    max-width: 600px;
    margin: 60px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
    text-align: center;
}

.upload-area {
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 60px 20px;
    margin: 30px 0;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #3498db;
    background: #f0f7fb;
}

.upload-icon {
    font-size: 48px;
    color: #bdc3c7;
    margin-bottom: 15px;
}

.upload-text {
    color: #7f8c8d;
    font-size: 1.1em;
}

#fileInput {
    display: none;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn:hover {
    background: #34495e;
    transform: translateY(-2px);
}

.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    display: none;
}
.status-success {
    background: #d4edda;
    color: #155724;
}
.status-error {
    background: #f8d7da;
    color: #721c24;
}

/* API Info Box on Admin Page */
.api-info {
    margin-top: 40px;
    text-align: left;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    font-size: 0.9em;
    color: #555;
}
.api-info code {
    background: #e9ecef;
    padding: 2px 5px;
    border-radius: 4px;
    color: #d63384;
}
/* Modal */
.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(5px);
}
.image-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Dialog Style Modal Content */
.image-modal-content.dialog-style {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    width: auto;
    min-width: 320px;
    border: 1px solid rgba(0,0,0,0.2);
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25em;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: left;
}

.modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #222; /* Dark background for image */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 0;
}

.image-modal-image {
    display: block;
    max-width: 100%;
    max-height: 70vh; /* Limit image height within dialog */
    width: auto;
    height: auto;
    object-fit: contain;
}

.modal-footer {
    padding: 15px;
    border-top: 1px solid #e5e5e5;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-footer .btn {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
}
.btn-secondary:hover {
    background: #bdc3c7;
    color: #2c3e50;
    transform: translateY(-2px);
}

.btn-primary {
    background: #3498db;
    color: #fff;
}
.btn-primary:hover {
    background: #2980b9;
}

/* Navigation Buttons inside Modal Body */
.image-modal-prev,
.image-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    color: #2c3e50;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.2s;
    z-index: 10;
    font-size: 1.5em;
    line-height: 1;
    padding-bottom: 4px; /* visual adjustment */
}

.image-modal-prev:hover,
.image-modal-next:hover {
    background: #fff;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    transform: translateY(-50%) scale(1.1);
}

.image-modal-prev { left: 15px; }
.image-modal-next { right: 15px; }

/* Rename Modal Specifics */
.rename-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rename-modal-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2c3e50;
    text-align: center;
}

.preview-container {
    height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #eee;
}

.preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-original-name {
    font-size: 0.9em;
    color: #7f8c8d;
    margin: 0;
    word-break: break-all;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-weight: 600;
    font-size: 0.9em;
    color: #34495e;
}

.rename-input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.2s;
}

.rename-input:focus {
    border-color: #3498db;
}

.hint {
    font-size: 0.8em;
    color: #95a5a6;
    margin: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.progress-info {
    text-align: center;
    font-size: 0.85em;
    color: #bdc3c7;
    margin-top: 5px;
}

    font-size: 18px;
}
.image-modal-prev,
.image-modal-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}
.image-modal-prev {
    left: -56px;
}
.image-modal-next {
    right: -56px;
}
.modal-open {
    overflow: hidden;
}