/* ============================================================
   CAMERA APP — Mac OS Classic Retro Style
   ============================================================ */

.camera-content {
  background: #E6E6E6;
  padding: 10px;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* ---- Split Layout ---- */
.pb-split {
  display: flex;
  gap: 10px;
  height: 100%;
}

.pb-left {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  background: #E6E6E6;
  border-top: 2px solid #6B6B6B;
  border-left: 2px solid #6B6B6B;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  padding: 8px;
}

.pb-right {
  flex: 1;
  position: relative;
  background: #fff;
  border-top: 2px solid #6B6B6B;
  border-left: 2px solid #6B6B6B;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pb-right.has-image {
  border-top: 2px solid #6B6B6B;
  border-left: 2px solid #6B6B6B;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
}

/* ---- Section Labels ---- */
.pb-section-label {
  font-weight: 700;
  font-size: 12px;
  color: #000;
  margin-bottom: 6px;
}

/* ---- Cards Row ---- */
.pb-cards-row {
  display: flex;
  gap: 8px;
}

.pb-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  background: #E6E6E6;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #6B6B6B;
  border-right: 2px solid #6B6B6B;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #000;
  transition: background 0.15s;
}

.pb-card:hover {
  background: #d0d0d0;
}

.pb-card.active {
  border-top: 2px solid #6B6B6B;
  border-left: 2px solid #6B6B6B;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  background: #9C9C9C;
  color: #000;
}

/* ---- Generate Button ---- */
.pb-generate-btn {
  display: block;
  width: 100%;
  padding: 8px 0;
  background: #E6E6E6;
  color: #000;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #6B6B6B;
  border-right: 2px solid #6B6B6B;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s;
}

.pb-generate-btn:hover:not(:disabled) {
  background: #d0d0d0;
}

.pb-generate-btn:active:not(:disabled) {
  border-top: 2px solid #6B6B6B;
  border-left: 2px solid #6B6B6B;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
}

.pb-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: #8A8A8A;
}

/* ---- Result Actions ---- */
.pb-result-actions {
  display: none;
  gap: 8px;
  margin-top: auto;
}

.pb-result-actions.visible {
  display: flex;
}

.pb-action-btn {
  flex: 1;
  padding: 7px 0;
  background: #E6E6E6;
  color: #000;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #6B6B6B;
  border-right: 2px solid #6B6B6B;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s;
}

.pb-action-btn:hover {
  background: #d0d0d0;
}

.pb-action-btn:active {
  border-top: 2px solid #6B6B6B;
  border-left: 2px solid #6B6B6B;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
}

/* ---- Upload Area ---- */
.camera-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  padding: 20px;
}

.camera-upload-area.drag-over {
  background: rgba(74, 144, 217, 0.06);
}

.camera-upload-icon {
  font-size: 40px;
  margin-bottom: 10px;
  display: block;
}

.camera-upload-text {
  font-size: 12px;
  color: #666;
  margin-bottom: 12px;
}

.camera-browse-btn {
  padding: 6px 16px;
  background: #E6E6E6;
  color: #000;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #6B6B6B;
  border-right: 2px solid #6B6B6B;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
}

.camera-browse-btn:hover {
  background: #d0d0d0;
}

.camera-browse-btn:active {
  border-top: 2px solid #6B6B6B;
  border-left: 2px solid #6B6B6B;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
}

/* ---- Preview ---- */
.camera-preview {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.camera-preview.visible {
  display: flex;
}

.camera-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ---- Result ---- */
.camera-result {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.camera-result.visible {
  display: flex;
}

.camera-result-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ---- Loading Overlay ---- */
.camera-loading {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(230, 230, 230, 0.85);
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.camera-loading.visible {
  display: flex;
}

.camera-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #ccc;
  border-top-color: #000;
  border-radius: 50%;
  animation: camera-spin 0.8s linear infinite;
}

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

.camera-loading-text {
  margin-top: 8px;
  font-size: 12px;
  color: #000;
}

/* ---- Error ---- */
.camera-error {
  display: none;
  width: 100%;
  padding: 6px 8px;
  color: #c00;
  font-size: 11px;
  text-align: center;
  box-sizing: border-box;
}

.camera-error.visible {
  display: block;
}

/* ---- WinXP theme adjustments ---- */
.theme-winxp .pb-card,
.theme-winxp .pb-generate-btn,
.theme-winxp .pb-action-btn,
.theme-winxp .camera-browse-btn {
  border-radius: 0;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 768px) {
  .pb-split {
    flex-direction: column;
  }

  .pb-left {
    flex: none;
    width: 100%;
    max-height: 40%;
    overflow-y: auto;
  }
}
