/* margin-bottom: var(--spacing-lg);
padding-bottom: var(--spacing-md); */

#camera-screen {
  height:100vh;
  height: 100dvh;
  padding:0;
}

/* Show expense mode toggle only on camera screen on mobile */
@media (max-width: 768px) {
  #camera-screen.active {
      height: 100vh;
      height: 100dvh;
      position: relative;
      overflow: visible;
  }

  #camera-screen.active .expense-mode-toggle {
      display: flex;
  }

  /* Hide bottom nav when camera screen is active on mobile */
  #camera-screen.active ~ .bottom-nav {
      display: none;
  }
}

/* Camera Interface */
.camera-content {
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: black;
  height: 100vh;
  height: 100dvh;
  padding-top: calc(40px + 2*var(--spacing-md)); /* compensate for merged header+progress height */
  padding-bottom: calc(2*var(--spacing-lg) + 75px + var(--spacing-sm)); /* compensate for bottom controls height */
  overflow: hidden;
}

.camera-viewfinder {
    width: 100%;
    position: relative;
    background-color: #000;
    overflow: hidden;
    margin: 0;
    display: none;
    flex: 1;
}

.camera-viewfinder:not(.hidden) {
    display: flex;
}

.camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.camera-frame {
    display: none;
    width: 200px;
    height: 200px;
    border: 2px solid white;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
}

/* Mobile: Move focal square up to account for bottom controls */
@media (max-width: 768px) {
    /*.camera-frame {
        transform: translateY(-40px);
    }
    */
}

.photo-guide {
    position: absolute;
    top: var(--spacing-lg);
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    z-index: 10;
}

.photo-counter {
    display: none;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    background: rgba(0, 0, 0, 0.6);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-lg);
}

.photo-instruction {
    font-size: 0.875rem;
    background: rgba(0, 0, 0, 0.6);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-lg);
    display: inline-block;
}

.photo-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 99;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.photo-progress .back-button {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

/* Camera Mode Indicator - shows current mode at top of camera */
.camera-mode-indicator {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.95rem;
    font-weight: 600;
    font-style: italic;
    color: var(--light-blue);
    transition: opacity 0.3s ease;
}

.camera-mode-indicator.expense-mode {
    color: #64b54e;
}

.camera-mode-indicator.job-mode {
    color: var(--primary-purple);
}

.camera-mode-indicator.hidden {
    display: none;
}

.photo-progress .progress-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transition: background-color 0.3s ease;
}

.progress-dot.active {
    background-color: white;
}

.progress-dot.completed {
    background-color: var(--success);
}

.captured-thumbnails {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.captured-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border);
    position: relative;
}

.captured-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.captured-thumbnail .photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.625rem;
    padding: 2px;
    text-align: center;
}

.delete-thumbnail-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background-color: rgba(244, 67, 54, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.625rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.delete-thumbnail-btn:hover {
    background-color: var(--error);
    transform: scale(1.1);
}

.complete-capture-btn {
    position: absolute;
    bottom: calc(2*var(--spacing-lg) + 75px + var(--spacing-sm) + 50px); /* compensate for bottom controls height + 50px spacing */
    left: var(--spacing-lg);
    right: var(--spacing-lg);
    padding: var(--spacing-sm);
    background-color: transparent;
    border-radius: var(--radius-md);
    display: flex;
    flex-shrink: 0;
    justify-content: center;
    gap: var(--spacing-sm);
    z-index: 1001; /* Higher z-index to ensure it appears above everything */
}

.complete-capture-btn .primary-btn {
    flex: 1;
    background-color: var(--primary-purple);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    padding: var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-lg);
}

.complete-capture-btn .primary-btn:hover {
    background-color: hsl(266, 35%, 45%);
    transform: translateY(-1px);
}


.camera-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    background-color: var(--background);
    padding: var(--spacing-xl);
}

.camera-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.camera-placeholder p {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
}

.camera-tip {
    font-size: 0.875rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.camera-controls {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    align-items: center;
    position: absolute; /* Changed to fixed to position relative to viewport */
    bottom: 0; /* Much lower, into the white space area */
    left: 0;
    right: 0;
    padding: var(--spacing-lg);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000; /* Higher z-index to ensure it appears above navigation */
}
camera-control-buttons {
    display: flex;
    width:100vw;
    min-width: 100vw;
    flex-shrink:0;
}

.camera-control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    min-width: 60px;
}

.camera-control-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#barcode-scan-button {
    display:none;
}

.capture-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: white;
    color: #000;
    font-size: 2rem;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.capture-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

.gallery-btn i,
.barcode-btn i {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.gallery-btn span,
.barcode-btn span {
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
}



/* Expense Mode Toggle (Mobile Camera View Only) */
.expense-mode-toggle {
  /* display: none; */
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background-color: var(--surface);
  /*
  border-top: 1px solid var(--border);
  position: absolute;
  bottom: 120px;
  left: 0;
  right: 0;
  z-index: 100;
  */
}

.expense-mode-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}
