/* Alapbeállítások */
:root {
    --primary: #03422f; /* esküvői zöld */
    --primary-dark: #022d21;
    --bg-light: #ffffff;
    --bg-gradient-start: #eaf6f0; /* halvány zöld átmenet */
    --text: #072a20;
    --text-light: #4f6b63;
    --border: #e6eee9;
    --success: #2e7d32; /* zöld siker */
    --warning: #ffb300; /* figyelmeztetés */
    --error: #b00020; /* visszafogott piros hibákhoz */
    --shadow: 0 2px 8px rgba(3, 66, 47, 0.08);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    background: var(--bg-light);
    color: var(--text);
    line-height: 1.6;
}

/* Login oldal */
.login-container {
    min-height: 100vh;
    background: radial-gradient(circle at top, var(--bg-gradient-start) 0%, var(--bg-light) 40%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    margin: 0;
    font-size: 2rem;
    color: var(--primary);
}

.login-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 32px;
    max-width: 500px;
    text-align: center;
}

.login-text {
    font-size: 1rem;
    margin: 16px 0;
    color: var(--text);
}

.login-text strong {
    color: var(--primary);
    font-weight: 600;
}

.login-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 12px 0;
}

.token-url-box {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
}

.token-url-box p {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.token-url-box code {
    display: block;
    background: white;
    padding: 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    word-break: break-all;
    border: 1px solid var(--border);
    color: var(--text);
}

.login-footer {
    margin-top: 24px;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Fő oldal */
.page {
    background: linear-gradient(180deg, var(--bg-light) 0%, white 20%);
    min-height: 100vh;
}

.page-header {
    background: transparent;
    color: white;
    padding: 16px;
    text-align: center;
}

.page-header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.logo {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    display: block;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .logo {
        max-height: 100px;
    }
}

@media (min-width: 1024px) {
    .logo {
        max-height: 120px;
    }
}

.page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

@media (min-width: 768px) {
    .page-content {
        padding: 32px 16px;
    }
}

/* Feltöltési szekció */
.upload-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.upload-disabled {
    background: #fff6f6;
    border: 1px solid #ffd6d6;
    color: #8a1f1f;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.btn.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.upload-section h2 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.3rem;
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 32px 16px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone:hover {
    border-color: var(--primary);
    background: #f0fcf8;
}

.dropzone.dragover {
    border-color: var(--primary);
    background: #f0fcf8;
    transform: scale(1.02);
}

.dropzone-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.dropzone-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

#fileInput {
    display: none;
}

/* Gomb */
.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(3, 66, 47, 0.18);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(3, 66, 47, 0.22);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    background: var(--primary);
    color: white;
}

.btn-small:hover {
    background: var(--primary-dark);
}

/* Feltöltési státusz */
.upload-status {
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.status-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid var(--border);
}

/* Desktop: responsive grid for status items — auto-fit columns (2–4 cols depending on width) */
@media (min-width: 700px) {
    .upload-status {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
        align-items: start;
        max-height: 400px;
        overflow-y: auto;
    }

    .status-item {
        width: 100%;
        max-width: none;
        margin-bottom: 0; /* grid gap handles spacing */
    }

    .status-content {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.status-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #eee;
    flex-shrink: 0;
}

.status-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-content {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    word-break: break-word;
}

.file-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.progress-bar-wrapper {
    background: #e0e0e0;
    border-radius: 999px;
    height: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    width: 0;
    transition: width 0.2s ease;
}

.status-text {
    font-size: 0.8rem;
    color: var(--text-light);
}

.status-text.success {
    color: var(--success);
    font-weight: 600;
}

.status-text.error {
    color: var(--error);
    font-weight: 600;
}

.status-item.success {
    border-left-color: var(--success);
}

.status-item.error {
    border-left-color: var(--error);
}

/* Figyelmeztető állapotok */
.status-text.warning {
    color: var(--warning);
    font-weight: 600;
}

.status-item.warning {
    border-left-color: var(--warning);
}

/* Galéria szekció */
.gallery-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.gallery-section h2 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.2rem;
}

.empty-message {
    color: var(--text-light);
    text-align: center;
    padding: 24px;
    font-style: italic;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.gallery-thumb {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.gallery-thumb:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(3, 66, 47, 0.12);
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

.modal-container {
    position: relative;
    z-index: 1001;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    overflow: hidden;
}

#modalImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 4px;
    width: 44px;
    height: 44px;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: all 0.2s ease;
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 12px;
}

.modal-next {
    right: 12px;
}

.modal-delete-btn {
    position: absolute;
    bottom: 12px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1002;
}

.modal-delete-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

.modal-delete-btn.hidden {
    display: none;
}

/* Inline two-step confirm appearance */
.modal-delete-btn.confirming {
    background: var(--warning);
    color: #111;
    box-shadow: 0 6px 16px rgba(255, 179, 0, 0.12);
}

/* Lábléc */
.page-footer {
    background: #f5f5f5;
    padding: 16px;
    border-top: 1px solid var(--border);
    margin-top: 32px;
}

/* Footer felső sor: copyright + privacy link */
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 12px;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-copyright {
    font-size: 0.8rem;
    color: #999;
    font-weight: 500;
}

.footer-privacy {
    text-align: right;
}

.footer-privacy-link {
    color: #999;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.footer-privacy-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.footer-storage {
    font-size: 0.8rem;
    color: #777;
    margin: 6px 0;
}

/* Megosztható URL szekció */
.footer-share-section {
    max-width: 600px;
    margin: 0 auto 12px;
}

.footer-share-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.footer-share-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    word-break: break-all;
    background: white;
    color: var(--text);
}

.footer-share-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(3, 66, 47, 0.1);
}

.footer-copy-btn {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* Footer alsó sor: linkek */
.footer-bottom {
    display: flex;
    justify-content: flex-start;
    max-width: 600px;
    margin: 0 auto;
	flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 16px;
    align-items: center;
	flex-wrap: wrap;
}

.footer-link-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #b0b0b0;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 6px;
	text-wrap: nowrap;
}

.footer-link-item:hover {
    color: #000;
}

.footer-fotoplus-link .footer-fotoplus-logo {
    height: 20px;
    width: auto;
    fill: #b0b0b0;
    transition: fill 0.2s ease;
}

.footer-fotoplus-link:hover .footer-fotoplus-logo {
    fill: #000;
}

.footer-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    stroke: currentColor;
    fill: currentColor;
}

/* Mobilon: full-width layout */
@media (max-width: 640px) {
    .footer-top {
        flex-direction: column;
        text-align: center;
    }

    .footer-privacy {
        text-align: center;
        width: 100%;
    }

    .footer-share-input-group {
        flex-direction: column;
    }

    .footer-share-input {
        width: 100%;
    }

    .footer-copy-btn {
        width: 100%;
    }

    .footer-bottom {
        justify-content: center;
    }

    .footer-links {
        justify-content: center;
        width: 100%;
    }
}

/* Privacy oldal */
.privacy-page .page-content {
    max-width: 800px;
}

.privacy-content section {
    margin-bottom: 32px;
}

.privacy-content h2 {
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}

.privacy-content ul {
    padding-left: 20px;
}

.privacy-content li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.privacy-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    .page-header h1 {
        font-size: 1.3rem;
    }

    .upload-section {
        padding: 16px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .modal-container {
        max-width: 95%;
        max-height: 95vh;
    }

    .modal-prev,
    .modal-next {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .modal-prev {
        left: 4px;
    }

    .modal-next {
        right: 4px;
    }
}
