/* 2차 협력사 일상점검 시스템 - Premium Glassmorphism Theme (style.css) */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
  --font-family: 'Outfit', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Color Palette (Clean Light Theme - Default) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-hover: rgba(241, 245, 249, 0.95);
  --border-glass: rgba(226, 232, 240, 0.8);
  --border-focus: rgba(37, 99, 235, 0.5);
  
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --text-dark: #0f172a;
  
  --primary: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.15);
  
  --ok-color: #16a34a;
  --ok-glow: rgba(22, 163, 74, 0.15);
  --ng-color: #dc2626;
  --ng-glow: rgba(220, 38, 38, 0.15);
  --na-color: #d97706;
  --na-glow: rgba(217, 119, 6, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Theme Specific Variables */
  --scrollbar-hover: rgba(0, 0, 0, 0.15);
  --logo-gradient: linear-gradient(to right, #0f172a, #64748b);
  --success-overlay-bg: rgba(15, 23, 42, 0.6);
  --chart-bg: rgba(0, 0, 0, 0.04);
}

:root[data-theme="dark"] {
  /* Color Palette (Sleek Dark Theme) */
  --bg-primary: #080c14;
  --bg-secondary: #0d1321;
  --bg-glass: rgba(18, 26, 47, 0.65);
  --bg-glass-hover: rgba(26, 38, 68, 0.8);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.6);
  
  --text-primary: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #111827;
  
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.35);
  
  --ok-color: #10b981;
  --ok-glow: rgba(16, 185, 129, 0.25);
  --ng-color: #ef4444;
  --ng-glow: rgba(239, 68, 68, 0.25);
  --na-color: #f59e0b;
  --na-glow: rgba(245, 158, 11, 0.25);
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);

  --scrollbar-hover: rgba(255, 255, 255, 0.2);
  --logo-gradient: linear-gradient(to right, #ffffff, #9ca3af);
  --success-overlay-bg: rgba(8, 12, 20, 0.95);
  --chart-bg: rgba(255, 255, 255, 0.03);
}

/* Base Reset & Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.05) 0px, transparent 70%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-shadow: 0 0 8px var(--primary-glow);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.15);
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.mobile-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* Header & Typography */
h1, h2, h3, h4, h5 {
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 0.5em;
}

.text-muted {
  color: var(--text-muted);
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--text-primary), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glassmorphism Cards */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  margin-bottom: 1.5rem;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(59, 130, 246, 0.05);
}

/* Interactive Elements (Buttons) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-family);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
  background: var(--border-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: linear-gradient(135deg, var(--ng-color), #dc2626);
  color: white;
  box-shadow: 0 4px 14px var(--ng-glow);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Dashboard Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50px;
}

.badge-ok {
  background: rgba(16, 185, 129, 0.15);
  color: var(--ok-color);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-ng {
  background: rgba(239, 68, 68, 0.15);
  color: var(--ng-color);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-na {
  background: rgba(245, 158, 11, 0.15);
  color: var(--na-color);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Inspection Checklist UI (inspect.html) */
.checklist-item {
  border-bottom: 1px solid var(--border-glass);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-text {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.5;
}

.checklist-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.option-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.option-btn i {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

/* 숨겨진 오리지널 라디오 */
.option-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* 상태별 체크 시 하이라이트 */
.option-ok:hover, .option-ok.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--ok-color);
  color: var(--ok-color);
  box-shadow: 0 0 12px var(--ok-glow);
}

.option-ng:hover, .option-ng.active {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--ng-color);
  color: var(--ng-color);
  box-shadow: 0 0 12px var(--ng-glow);
}

.option-na:hover, .option-na.active {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--na-color);
  color: var(--na-color);
  box-shadow: 0 0 12px var(--na-glow);
}

/* Canvas Signature Pad */
.signature-container {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
}

.signature-pad {
  width: 100%;
  height: 150px;
  display: block;
  cursor: crosshair;
}

.signature-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-glass);
}

/* Metrics Dashboard Cards (index.html) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Data Table Styles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

th {
  background: var(--bg-primary);
  padding: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-glass);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Equipment Grid & QR Generation Card */
.eq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.eq-card {
  position: relative;
  overflow: hidden;
}

.eq-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.eq-qr-container {
  background: white;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin: 0.5rem 0;
  box-shadow: var(--shadow-sm);
}

.eq-qr-container img,
.eq-qr-container canvas {
  display: block;
  width: 90px !important;
  height: 90px !important;
}

/* Real-Time Scanner Overlay (scanner.html) */
#reader {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass) !important;
}

#reader__scan_region {
  background: #000;
}

#reader__dashboard {
  background: var(--bg-glass);
  color: var(--text-primary);
  border-top: 1px solid var(--border-glass);
  padding: 1rem !important;
}

/* Success Modal/Screen Overlay */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.success-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.success-box {
  text-align: center;
  max-width: 400px;
  padding: 2.5rem;
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-overlay.active .success-box {
  transform: scale(1);
}

.success-checkmark {
  width: 80px;
  height: 80px;
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--ok-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--ok-color);
  font-size: 2.5rem;
  box-shadow: 0 0 30px var(--ok-glow);
}

/* Navigation Drawer/Menu (mobile-optimized) */
.nav-tab {
  display: flex;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  padding: 0.35rem;
  gap: 0.25rem;
  margin-bottom: 2rem;
}

.tab-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 50px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 10px var(--primary-glow);
}

/* CSS Chart Implementation */
.chart-container {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-glass);
  margin-top: 1rem;
}

.chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar-bg {
  width: 32px;
  height: 100%;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}

.chart-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--primary), rgba(59, 130, 246, 0.2));
  border-radius: 16px 16px 0 0;
  transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
  height: 0;
  box-shadow: 0 0 10px var(--primary-glow);
}

.chart-bar.bar-ng {
  background: linear-gradient(180deg, var(--ng-color), rgba(239, 68, 68, 0.2));
  box-shadow: 0 0 10px var(--ng-glow);
}

.chart-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  white-space: nowrap;
}

.chart-tooltip {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-secondary);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.chart-bar-bg:hover .chart-tooltip {
  opacity: 1;
  top: -30px;
}

/* Keyframes & Utility Styles */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.pulse {
  animation: pulse 2s infinite ease-in-out;
}

#modal-photo-img:hover {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}
