/*
 * Location : /assets/css/app.css
 * File     : app.css
 * Function : Bootstrap overrides, navbar brand, canvas overlay, wizard steps, mode toggle button
 * Version  : 1.2.0
 * Changelog:
 *   1.0.0 - 2025-01-01 - Initial release
 *   1.1.0 - 2025-01-15 - Canvas mode toggle styles
 *   1.2.0 - 2025-02-01 - Fullscreen canvas overlay
 */

/* ── Root variables ─────────────────────────────────────────────────────────── */
:root {
    --brand-dark:   #1a1f2e;
    --brand-mid:    #252d42;
    --brand-accent: #f0a500;
    --border-color: #dee2e6;
    --canvas-rect-color: rgba(220, 53, 69, 0.45);
    --canvas-rect-border: rgba(220, 53, 69, 0.9);
}

/* ── Navbar ──────────────────────────────────────────────────────────────────── */
#main-navbar {
    background: var(--brand-dark);
    border-bottom: 3px solid var(--brand-accent);
    min-height: 60px;
}
.navbar-logo {
    border-radius: 4px;
    object-fit: contain;
    max-width: 120px;
}
.navbar-company-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
}

/* ── Wizard progress bar ─────────────────────────────────────────────────────── */
.wizard-steps {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.wizard-step {
    flex: 1;
    padding: 0.65rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    background: #f8f9fa;
    color: #6c757d;
    border-right: 1px solid var(--border-color);
    cursor: default;
    transition: background 0.2s, color 0.2s;
}
.wizard-step:last-child { border-right: none; }
.wizard-step.active {
    background: var(--brand-dark);
    color: var(--brand-accent);
}
.wizard-step.done {
    background: #e8f5e9;
    color: #388e3c;
}
.wizard-step .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 6px;
    background: rgba(0,0,0,0.08);
}
.wizard-pane { display: none; }
.wizard-pane.active { display: block; }

/* ── Sticky footer buttons ───────────────────────────────────────────────────── */
.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 100;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(4px);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    margin: 0 -12px -24px;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ── Photo card ──────────────────────────────────────────────────────────────── */
.photo-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 1.25rem;
}
.photo-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
}
.photo-card-body {
    position: relative;
}

/* ── Canvas mode toggle button ───────────────────────────────────────────────── */
.canvas-mode-btn {
    min-width: 130px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: all 0.15s ease;
}
.canvas-mode-btn[data-mode="scroll"] {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
}
.canvas-mode-btn[data-mode="draw"] {
    background: #f0a500;
    border-color: #e09800;
    color: #1a1f2e;
}
.canvas-mode-btn[data-mode="fullscreen"] {
    background: #dc3545;
    border-color: #c82333;
    color: #fff;
}

/* ── Canvas wrapper ──────────────────────────────────────────────────────────── */
.canvas-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    line-height: 0;
}
.canvas-wrapper canvas {
    max-width: 100%;
    display: block;
}

/* ── Fullscreen canvas overlay ───────────────────────────────────────────────── */
.canvas-fullscreen-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    flex-direction: column;
}
.canvas-fullscreen-overlay.active {
    display: flex;
}
.canvas-fullscreen-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--brand-dark);
    border-bottom: 2px solid var(--brand-accent);
    gap: 0.75rem;
    flex-shrink: 0;
}
.canvas-fullscreen-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
#fullscreen-canvas-container canvas {
    display: block;
}

/* ── Annotation point badge ──────────────────────────────────────────────────── */
.annotation-list .badge-point {
    display: inline-block;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--canvas-rect-border);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    margin-right: 4px;
}

/* ── Drop zone ───────────────────────────────────────────────────────────────── */
#drop-zone {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
#drop-zone.dragover {
    border-color: var(--brand-accent);
    background: #fffbf0;
    color: var(--brand-dark);
}
#drop-zone i { font-size: 2rem; display: block; margin-bottom: 0.5rem; }

/* ── DataTables tweaks ───────────────────────────────────────────────────────── */
.dataTables_wrapper .dataTables_filter input {
    margin-left: 0.5rem;
}
table.dataTable td { vertical-align: middle; }

/* ── Checklist conditional fields ───────────────────────────────────────────── */
.checklist-extra {
    display: none;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}
.checklist-extra.visible { display: block; }

/* ── Login page ──────────────────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: var(--brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-card-header {
    background: var(--brand-mid);
    padding: 2rem;
    text-align: center;
    border-bottom: 3px solid var(--brand-accent);
}
.login-card-header img { max-height: 60px; margin-bottom: 0.75rem; }
.login-card-header h1 {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}
.login-card-body { padding: 2rem; }
.login-card .btn-login {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: var(--brand-dark);
    font-weight: 700;
}
.login-card .btn-login:hover {
    background: #e09800;
}

/* ── Utility ─────────────────────────────────────────────────────────────────── */
.text-accent { color: var(--brand-accent) !important; }
.bg-brand    { background: var(--brand-dark) !important; }

/* ── Impersonation banner ────────────────────────────────────────────────────── */
.impersonation-banner {
    background: #ff6b35;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 2px solid #c94f1e;
    position: sticky;
    top: 60px; /* below navbar */
    z-index: 1020;
}
.impersonation-banner .btn-light {
    color: #c94f1e;
    font-weight: 700;
    font-size: 0.8rem;
}

/* ── Admin panel ─────────────────────────────────────────────────────────────── */
.admin-sidebar {
    width: 240px;
    min-height: calc(100vh - 60px);
    background: var(--brand-mid);
    padding: 1.25rem 0;
    flex-shrink: 0;
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 0.55rem 1.25rem;
    font-size: 0.88rem;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.07);
    border-left-color: var(--brand-accent);
}
.admin-sidebar .nav-section {
    color: rgba(255,255,255,0.35);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1rem 1.25rem 0.3rem;
}
.admin-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}
.admin-content {
    flex: 1;
    padding: 1.75rem;
    overflow-x: hidden;
}
