/* 営業管理システム カスタムスタイル */

/* ===== Color Scheme Variables ===== */
:root {
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
}

/* ===== Navigation ===== */
.nav-btn {
  color: rgba(255, 255, 255, 0.8);
  position: relative;
}

.nav-btn:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.15);
}

.nav-btn.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, white, transparent);
  border-radius: 1px;
}

/* Mobile menu animation */
#mobile-nav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 0;
}

#mobile-nav:not(.hidden) {
  max-height: 300px;
  opacity: 1;
}

/* ===== Card Styles ===== */
.deal-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  position: relative;
}

.deal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.deal-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 40px -12px rgba(99, 102, 241, 0.2), 
              0 8px 16px -8px rgba(0, 0, 0, 0.1),
              0 0 0 1px rgba(99, 102, 241, 0.1);
}

.deal-card:hover::before {
  opacity: 1;
}

/* Task Card Styles */
.task-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.task-card:hover {
  transform: translateY(-2px);
}

/* Progress circle animation */
.deal-card svg circle {
  transition: stroke-dasharray 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Amount gradient text support */
.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
}

/* Pulse animation for status indicator */
@keyframes pulse-slow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.deal-card .animate-pulse {
  animation: pulse-slow 2s ease-in-out infinite;
}

/* Dashboard stat cards */
.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.1);
}

/* Rank badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.rank-a {
  background-color: #dcfce7;
  color: #166534;
}

.rank-b {
  background-color: #dbeafe;
  color: #1e40af;
}

.rank-c {
  background-color: #fef3c7;
  color: #92400e;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-negotiating {
  background-color: #fef3c7;
  color: #92400e;
}

.status-ordered {
  background-color: #dbeafe;
  color: #1e40af;
}

.status-collected {
  background-color: #dcfce7;
  color: #166534;
}

.status-lost {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Task progress bar */
.task-progress {
  height: 6px;
  background-color: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.task-progress-bar {
  height: 100%;
  background-color: #6366f1;
  transition: width 0.3s ease;
}

/* Step indicators */
.step-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.step-completed {
  background-color: #22c55e;
  color: white;
}

.step-current {
  background-color: #6366f1;
  color: white;
}

.step-pending {
  background-color: #e5e7eb;
  color: #6b7280;
}

/* Amount formatting */
.amount {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 600;
}

.amount-large {
  font-size: 1.5rem;
}

/* Modal animations */
.modal-enter {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Deal Modal - Rank Card Selection */
.rank-card .rank-card-inner {
  transition: all 0.2s ease;
}

.rank-card:hover .rank-card-inner {
  transform: translateY(-2px);
}

/* Deal Modal - Status Steps */
.status-step {
  z-index: 1;
  transition: transform 0.2s ease;
}

.status-step:hover {
  transform: scale(1.05);
}

.status-step-icon {
  transition: all 0.3s ease;
}

/* Deal Modal - Header gradient variations */
#deal-modal-header.rank-a {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

#deal-modal-header.rank-b {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

#deal-modal-header.rank-c {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

/* Deal Modal - Floating footer shadow */
#deal-modal .shadow-\[0_-4px_12px_rgba\(0\,0\,0\,0\.05\)\] {
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Table styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.data-table tbody tr:hover {
  background-color: #f9fafb;
}

/* Form styles */
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Task row */
.task-row {
  display: grid;
  grid-template-columns: 40px 120px 1fr 1fr 60px;
  gap: 0.5rem;
  align-items: start;
  padding: 0.5rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.task-row input,
.task-row textarea {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.task-row input[type="date"] {
  width: 100%;
}

.task-row textarea {
  min-height: 60px;
  resize: vertical;
}

.task-row input:focus,
.task-row textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Task header */
.task-header {
  display: grid;
  grid-template-columns: 40px 120px 1fr 1fr 60px;
  gap: 0.5rem;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #e5e7eb;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-dot {
  position: absolute;
  left: -1.625rem;
  width: 1rem;
  height: 1rem;
  background-color: #6366f1;
  border-radius: 50%;
  border: 2px solid white;
}

.timeline-dot.completed {
  background-color: #22c55e;
}

.timeline-dot.pending {
  background-color: #d1d5db;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .task-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  
  .nav-btn span {
    display: none;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  color: white;
  font-weight: 500;
  z-index: 9999;
  animation: slideIn 0.3s ease-out;
}

.toast-success {
  background-color: #22c55e;
}

.toast-error {
  background-color: #ef4444;
}

.toast-info {
  background-color: #3b82f6;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
