/* ================================================================
   PHOTOLOG — Capture modal, gallery, lightbox, AI analysis
   Estilos dedicados para o modulo de registro fotografico.
   Usa classes .ecbt-* (design-tokens.css) como base.
   ================================================================ */

/* --- Capture Modal: Source buttons --- */
.photolog-source-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.photolog-source-btn {
    flex: 1;
    text-align: center;
    font-size: 13px;
    padding: 8px 12px;
    background: var(--bg-primary, #121220);
    border: 1px dashed #555;
    border-radius: 6px;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    transition: all 0.15s ease;
}
.photolog-source-btn:hover {
    border-color: var(--accent, #60a5fa);
    color: var(--accent, #60a5fa);
}

/* --- Capture Modal: Preview area --- */
.photolog-preview-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    background: var(--bg-primary, #121220);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.photolog-preview-video {
    display: none;
    max-width: 100%;
    max-height: 300px;
}

.photolog-preview-img {
    display: none;
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.photolog-preview-placeholder {
    color: var(--text-tertiary, #666);
    font-size: 14px;
}

/* --- Capture Modal: Shutter button --- */
.photolog-shutter-btn {
    display: none;
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: rgba(255, 0, 0, 0.7);
    cursor: pointer;
    transition: transform 0.15s ease;
}
.photolog-shutter-btn:hover {
    transform: translateX(-50%) scale(1.1);
}

/* --- Capture Modal: GPS indicator --- */
.photolog-gps-info {
    display: none;
    font-size: 12px;
    color: var(--text-tertiary, #666);
}

/* --- Capture Modal: Loading overlay --- */
.photolog-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: var(--bg-secondary, #1e1e2e);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ================================================================
   GALLERY MODAL
   ================================================================ */

.photolog-gallery-dialog {
    width: 100%;
    max-width: 820px;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary, #1e1e2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* --- Gallery: Filter constraints --- */
.photolog-filter-el { max-width: 200px; }
.photolog-filter-status { max-width: 140px; }

/* --- Gallery: Grid --- */
.photolog-gallery-grid {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

/* --- Gallery: Cards --- */
.photolog-gallery-card {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-primary, #121220);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid var(--border-color, #333);
}
.photolog-gallery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--accent, #60a5fa);
}

.photolog-gallery-card-img {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
}
.photolog-gallery-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photolog-gallery-card-meta {
    padding: 4px 6px;
    font-size: 11px;
    color: var(--text-tertiary, #666);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photolog-gallery-card-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Gallery: Sync badges --- */
.photolog-sync-badge--synced  { color: #4caf50; }
.photolog-sync-badge--local   { color: #888; }
.photolog-sync-badge--failed  { color: #f44336; }
.photolog-sync-badge--unresolvable { color: #666; }

/* --- Gallery: Empty state --- */
.photolog-gallery-empty { grid-column: 1 / -1; }

/* --- Gallery: Thumb strip (used in inspector) --- */
.photolog-thumb-strip::-webkit-scrollbar { height: 6px; }
.photolog-thumb-strip::-webkit-scrollbar-thumb {
    background: var(--neutral-600, #444);
    border-radius: 3px;
}

.photolog-thumb-card {
    transition: transform 0.15s ease;
    border: 1px solid var(--border-color, #333);
}
.photolog-thumb-card:hover {
    transform: scale(1.05);
    border-color: var(--accent, #60a5fa);
}

/* ================================================================
   LIGHTBOX
   ================================================================ */

.photolog-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9100;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* --- Lightbox: Navigation bar --- */
.photolog-lightbox-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 900px;
    padding: 8px 16px;
    color: #fff;
}

.photolog-lightbox-nav-btn {
    background: transparent;
    border: 1px solid #555;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.photolog-lightbox-nav-btn:hover {
    border-color: var(--accent, #60a5fa);
    color: var(--accent, #60a5fa);
}
.photolog-lightbox-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Lightbox: Viewport --- */
.photolog-lightbox-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: calc(100vh - 140px);
    overflow: hidden;
    padding: 8px;
}

.photolog-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* --- Lightbox: Metadata bar --- */
.photolog-lightbox-meta {
    width: 100%;
    max-width: 900px;
    padding: 8px 16px;
    color: #ccc;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photolog-lightbox-meta-sub {
    font-size: 11px;
}

.photolog-lightbox-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* --- Lightbox: Action buttons --- */
.photolog-lightbox-action-btn {
    background: transparent;
    border: 1px solid #555;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.photolog-lightbox-action-btn--accent {
    color: #4fc3f7;
    border-color: #4fc3f7;
}
.photolog-lightbox-action-btn--accent:hover {
    background: rgba(79, 195, 247, 0.15);
}
.photolog-lightbox-action-btn--accent:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.photolog-lightbox-action-btn--danger {
    color: #f44336;
    border-color: #f44336;
}
.photolog-lightbox-action-btn--danger:hover {
    background: rgba(244, 67, 54, 0.15);
}

/* ================================================================
   AI ANALYSIS PANEL
   ================================================================ */

.photolog-ai-result {
    display: none;
    width: 100%;
    max-width: 900px;
    max-height: 250px;
    overflow-y: auto;
    padding: 12px 16px;
    background: rgba(30, 30, 50, 0.95);
    border-top: 1px solid #333;
    color: #ccc;
    font-size: 12px;
}

.photolog-ai-header {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.photolog-ai-header strong {
    font-size: 14px;
}

.photolog-ai-header-meta {
    font-size: 10px;
    color: #666;
}

/* --- AI: Summary block --- */
.photolog-ai-summary {
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}

/* --- AI: Condition badges --- */
.photolog-ai-condition {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    margin-right: 8px;
}
.photolog-ai-condition--good     { background: #4caf50; }
.photolog-ai-condition--fair     { background: #ff9800; }
.photolog-ai-condition--poor     { background: #f44336; }
.photolog-ai-condition--critical { background: #d32f2f; }

/* --- AI: Sections --- */
.photolog-ai-section-title {
    margin-bottom: 6px;
    font-weight: 600;
}

.photolog-ai-list {
    margin: 0 0 8px 16px;
    padding: 0;
}
.photolog-ai-list li {
    margin-bottom: 3px;
}

/* --- AI: Severity dots --- */
.photolog-ai-sev--info     { color: #888; }
.photolog-ai-sev--low      { color: #4caf50; }
.photolog-ai-sev--medium   { color: #ff9800; }
.photolog-ai-sev--high     { color: #f44336; }
.photolog-ai-sev--critical { color: #d32f2f; }

.photolog-ai-location {
    color: #666;
}

.photolog-ai-recommendation {
    color: #4fc3f7;
    margin-left: 16px;
}

/* --- AI: Regulatory flags --- */
.photolog-ai-reg-flag {
    padding: 4px 8px;
    margin-bottom: 3px;
    background: rgba(255, 255, 255, 0.03);
}
.photolog-ai-reg-flag--violation { border-left: 3px solid #f44336; }
.photolog-ai-reg-flag--warning   { border-left: 3px solid #ff9800; }
.photolog-ai-reg-flag--info      { border-left: 3px solid #888; }

/* --- AI: PDPLU tags --- */
.photolog-ai-pdplu-tag {
    display: inline-block;
    padding: 1px 6px;
    margin: 1px;
    border-radius: 3px;
    background: rgba(79, 195, 247, 0.15);
    font-size: 11px;
}

/* --- AI: Status messages --- */
.photolog-ai-status {
    text-align: center;
    padding: 20px;
    color: #888;
}

.photolog-ai-error {
    padding: 12px;
    color: #f44336;
}

.photolog-ai-warning {
    padding: 12px;
    color: #ff9800;
}

.photolog-ai-config-btn {
    color: inherit;
    margin-left: 8px;
    background: transparent;
    border: 1px solid currentColor;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}
