/* ============================================================
   RKOM Photo Search - Boomi Branded Styles
   ============================================================ */

:root {
  --navy: #072B55;
  --coral: #FF7C66;
  --purple: #A03291;
  --periwinkle: #4B4FE2;
  --blue: #0085F0;
  --green: #0EC38B;
  --light-bg: #F7F8FA;
  --card-bg: #FFFFFF;
  --text: #333333;
  --text-muted: #666666;
  --border: #E0E4E8;
  --shadow: 0 2px 8px rgba(7, 43, 85, 0.08);
  --shadow-lg: 0 4px 16px rgba(7, 43, 85, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--light-bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--periwinkle) 100%);
  color: white;
  padding: 2rem;
  text-align: center;
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

#auth-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

#user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

#user-name {
  font-weight: 500;
}

#signout-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}

#signout-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Main */
main {
  flex: 1;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

section {
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.help-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Drop Zone */
#drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background: var(--card-bg);
}

#drop-zone:hover,
#drop-zone.dragover {
  border-color: var(--coral);
  background: rgba(255, 124, 102, 0.04);
}

.drop-zone-content svg {
  color: var(--coral);
  margin-bottom: 0.75rem;
}

.drop-zone-content p {
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.or-text {
  font-size: 0.85rem;
}

.file-btn {
  display: inline-block;
  background: var(--coral);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  margin-top: 0.5rem;
  transition: background 0.2s ease;
}

.file-btn:hover {
  background: #e86b56;
}

/* Face Previews */
#face-previews {
  margin-top: 1.5rem;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

#face-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.face-card {
  position: relative;
  width: 120px;
}

.face-card img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--green);
}

.face-card .remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 24px;
  text-align: center;
}

.face-card.no-face img {
  border-color: var(--coral);
}

.face-card .face-status {
  font-size: 0.75rem;
  text-align: center;
  margin-top: 0.25rem;
  color: var(--green);
  font-weight: 500;
}

.face-card.no-face .face-status {
  color: var(--coral);
}

/* Buttons */
.actions {
  display: flex;
  gap: 1rem;
}

.primary-btn {
  background: var(--coral);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary-btn:hover:not(:disabled) {
  background: #e86b56;
  box-shadow: var(--shadow);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-btn {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--border);
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  border-color: var(--navy);
}

/* Loading */
#loading {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Results */
#results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.result-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}

.result-card:hover {
  box-shadow: var(--shadow-lg);
}

.result-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.result-card .result-info {
  padding: 1rem;
}

.result-card .result-folder {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.result-card .result-filename {
  font-weight: 500;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-card .result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.confidence-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.confidence-high {
  background: rgba(14, 195, 139, 0.15);
  color: #0a9e6e;
}

.confidence-medium {
  background: rgba(0, 133, 240, 0.15);
  color: var(--blue);
}

.confidence-low {
  background: rgba(255, 124, 102, 0.15);
  color: #d45a45;
}

.drive-link {
  color: var(--periwinkle);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.drive-link:hover {
  text-decoration: underline;
}

/* Admin Section */
.admin-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

#index-status {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
