/* Strefa Klienta FOTO - Public styles */

.skf-wrap {
    width: 100%;
    margin: 40px auto;
    font-family: 'Inter', 'Helvetica Neue', sans-serif;
    color: #333;
}

.skf-wrap *,
.skf-wrap *::before,
.skf-wrap *::after {
    box-sizing: border-box;
}

/* Login */
.skf-login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.skf-login-container h2 {
    margin-bottom: 20px;
    font-weight: 600;
}

.skf-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.skf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: #fff;
    height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.skf-btn:active {
    transform: scale(0.98);
}

.skf-btn:hover {
    background: #333;
}

.skf-notice {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.skf-error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

/* Gallery Header */
.skf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.skf-header h1 {
    margin: 0;
    font-size: 2.2rem;
}

/* Sticky Menu & Filters */
.skf-folder-filters {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    padding: 15px 20px;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    overflow-x: auto;
    white-space: nowrap;
}

.skf-filter-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}

.skf-filter-btn:hover {
    color: #111;
}

.skf-filter-btn.active {
    color: #111;
    border-bottom: 2px solid #111;
}

/* Folders */
.skf-folder-section {
    margin-bottom: 60px;
    padding: 0;
}

.skf-folder-section h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #444;
}

/* Justified Gallery (CSS Flexbox cover layout) */
.skf-justified-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skf-photo-item {
    position: relative;
    flex-grow: calc(var(--w) / var(--h));
    flex-shrink: 0;
    width: calc(var(--w) / var(--h) * 200px);
    /* Explicit base width for older layout engines */
    height: 300px;
    overflow: hidden;
    background: #f5f5f5;
}

.skf-photo-item img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.skf-photo-item.skf-loaded img {
    opacity: 1;
}

/* Spinner shown before image loads */
.skf-img-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #888;
    border-radius: 50%;
    animation: skf-spin 0.8s linear infinite;
    pointer-events: none;
    transition: opacity 0.3s;
}

.skf-photo-item.skf-loaded .skf-img-spinner {
    opacity: 0;
}

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

.skf-justified-gallery::after {
    content: '';
    flex-grow: 999999999;
    height: 300px;
}

/* Responsiveness for justified */
@media (max-width: 800px) {
    .skf-photo-item {
        height: 200px;
        flex-basis: calc(var(--w) / var(--h) * 200px);
    }

    .skf-justified-gallery::after {
        height: 200px;
    }

    .skf-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 500px) {
    .skf-photo-item {
        height: 140px;
        flex-basis: calc(var(--w) / var(--h) * 140px);
    }

    .skf-justified-gallery::after {
        height: 140px;
    }

    .skf-justified-gallery {
        gap: 4px;
    }
}

/* Overlay & Interactions */
.skf-photo-overlay {
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 10px;
}

.skf-photo-item:hover .skf-photo-overlay {
    opacity: 1;
}

/* Touch support -> show slightly always or tap */
@media (max-width: 1024px) {
    .skf-photo-overlay {
        opacity: 1 !important;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 0 0 0 10px;
        padding: 4px;
    }
}

@media (hover: none) {
    .skf-photo-overlay {
        opacity: 1 !important;
    }
}

.skf-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background 0.2s;
    user-select: none;
    backdrop-filter: blur(2px);
}

@media (max-width: 600px) {
    .skf-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

.skf-icon:hover {
    transform: scale(1.1);
}

.skf-fav {
    filter: grayscale(1);
    background: rgba(0, 0, 0, 0.35) !important;
}

@media (hover: hover) {
    .skf-fav:hover {
        filter: grayscale(0);
    }
}

.skf-fav.active {
    filter: grayscale(0);
    background: rgba(0, 0, 0, 0.35) !important;
    animation: heartBeat 0.3s;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.skf-filename {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: #fff;
    font-size: 12px;
    pointer-events: none;
}

/* Spinner */
.skf-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-left-color: #111;
    border-radius: 50%;
    animation: skfspin 1s linear infinite;
    vertical-align: middle;
}

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

/* Czerwone obramowanie dla wybranych (ulubionych) zdjęć */
.skf-photo-item.is-favorite {
    outline: 4px solid #ff4b4b;
    outline-offset: -4px;
    z-index: 5;
}

/* Gallery Actions Area (Logout, Send Favs) */
.skf-gallery-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 20px 20px;
    margin-top: -10px;
}

.skf-btn-logout {
    background: #e74c3c !important;
}

.skf-btn-logout:hover {
    background: #c0392b !important;
}

#skf_send_favs_btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

#skf_send_favs_btn.active {
    background: #27ae60;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

/* Modal */
.skf-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.skf-modal-content {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.skf-modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.skf-modal-close:hover {
    color: #333;
}

.skf-modal h3 {
    margin-top: 0;
}

.skf-gallery-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

@media (max-width: 800px) {
    .skf-gallery-actions {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .skf-gallery-actions .skf-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
        justify-content: center;
    }
    #skf_send_favs_btn {
        margin-top: 15px;
    }
}