/* ===== Layout ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #1a1d23;
    color: #ccc;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.2s;
}
.sidebar.collapsed { transform: translateX(-240px); }
.sidebar-header { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sidebar-brand i { font-size: 1.5rem; color: #6ea8fe; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.5rem 0; }
.sidebar-nav .nav-link {
    color: #adb5bd;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0;
    transition: background 0.15s;
}
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-nav .nav-link.active { background: rgba(255,255,255,0.1); color: #fff; font-weight: 500; }
.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer .dropdown-toggle { color: #adb5bd; }
.sidebar-footer .dropdown-toggle:hover { color: #fff; }

.main-content {
    margin-left: 240px;
    min-height: 100vh;
    transition: margin-left 0.2s;
}
.sidebar.collapsed + .main-content { margin-left: 0; }

.sidebar-toggle { color: #6c757d; }

/* ===== Auth layout ===== */
.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}
.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ===== Album cards ===== */
.album-card { overflow: hidden; transition: transform 0.15s, box-shadow 0.15s; }
.album-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.album-cover { aspect-ratio: 4/3; overflow: hidden; background: #f0f0f0; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 3rem;
}

/* ===== Photo grid ===== */
.photo-thumb {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    background: #f0f0f0;
    cursor: pointer;
    position: relative;
}
.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}
.photo-thumb:hover img { transform: scale(1.05); }
.photo-detail-img {
    width: 100%;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    cursor: pointer;
    background: #000;
}
.photo-detail-img.fullscreen {
    position: fixed;
    inset: 0;
    max-height: 100vh;
    width: 100vw;
    z-index: 9999;
    border-radius: 0;
}

/* ===== PhotoSwipe custom buttons ===== */
.pswp__button--info-button,
.pswp__button--edit-button,
.pswp__button--download-button,
.pswp__button--rotate-cw-button,
.pswp__button--rotate-ccw-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    opacity: 0.75;
    transition: opacity 0.2s;
    cursor: pointer;
    background: none !important;
    background-image: none !important;
    border: none;
    padding: 0;
}
.pswp__button--info-button:hover,
.pswp__button--edit-button:hover,
.pswp__button--download-button:hover,
.pswp__button--rotate-cw-button:hover,
.pswp__button--rotate-ccw-button:hover { opacity: 1; }
.pswp__button--info-button svg,
.pswp__button--edit-button svg,
.pswp__button--download-button svg,
.pswp__button--rotate-cw-button svg,
.pswp__button--rotate-ccw-button svg { pointer-events: none; }

/* ===== Face grid ===== */
.face-grid-item { padding: 0.5rem; }
.face-thumb-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    object-fit: cover;
    display: block;
    margin: 0 auto;
    border: 3px solid transparent;
    transition: border-color 0.2s, transform 0.15s;
}
.face-thumb-circle:hover { border-color: #0d6efd; transform: scale(1.05); }
.face-placeholder {
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}
.face-name { font-size: 0.85rem; margin-top: 0.5rem; font-weight: 500; }

/* Face overlay boxes on photos */
.face-box {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    pointer-events: none;
    transition: opacity 0.2s, border-color 0.2s;
    opacity: 0;
}
.face-box.visible { opacity: 1; }
.face-box-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

/* Face identification dropdown (detail page) */
.face-suggest-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}
.face-suggest-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}
.face-suggest-item:hover { background: #f0f0f0; }

/* ===== Face suggest dropdown in lightbox ===== */
.pswp__face-suggest-item:hover { background: rgba(255,255,255,0.1); }

/* ===== PhotoSwipe info panel ===== */
.pswp__info-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: rgba(20, 20, 20, 0.95);
    color: #e0e0e0;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}
.pswp__info-panel.open { transform: translateX(0); }
.pswp__info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.95rem;
}
.pswp__info-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.pswp__info-close:hover { color: #fff; }
.pswp__info-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
}
.pswp__info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
}
.pswp__info-table td {
    padding: 0.25rem 0;
    vertical-align: top;
    border: none;
}
.pswp__info-label {
    color: #888;
    width: 95px;
    white-space: nowrap;
    padding-right: 0.5rem;
}
.pswp__info-desc {
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.5rem;
    color: #ccc;
}
.pswp__info-tags { margin-bottom: 0.75rem; }
.pswp__info-tag {
    display: inline-block;
    background: #0d6efd;
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    margin: 0.15rem 0.15rem 0 0;
}
.pswp__info-link {
    display: block;
    color: #6ea8fe;
    text-decoration: none;
    padding: 0.35rem 0;
    font-size: 0.8rem;
}
.pswp__info-link:hover { color: #9ec5fe; }
@media (max-width: 576px) {
    .pswp__info-panel { width: 260px; }
}

/* ===== Selection mode ===== */
.photo-select-overlay {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 10;
}
.photo-select-overlay .photo-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.photo-grid-item.selected .photo-thumb {
    outline: 3px solid #0d6efd;
    outline-offset: -3px;
}
.photo-grid-item.selected .photo-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(13, 110, 253, 0.15);
}

/* ===== Upload dropzone ===== */
.upload-dropzone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.05);
}

/* ===== Tags ===== */
.tag-badge { font-weight: 400; }
.tag-badge i:hover { opacity: 0.7; }

/* ===== Misc ===== */
.border-dashed { border-style: dashed !important; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-240px); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
}
