﻿/* ========== DASHBOARD APPLE DESIGN ========== */
:root {
  --primary: #0071e3;
  --primary-dark: #0056b3;
  --text-primary: #1d1d1d;
  --text-secondary: #666;
  --bg: #ffffff;
  --bg-light: #f5f5f7;
  --border: #d2d2d7;
  --shadow: 0 10px 40px rgba(0,0,0,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, ''Segoe UI'', ''Helvetica Neue'', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ========== HEADER ========== */
.dashboard-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.logo {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.header-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
  font-size: 0.95rem;
}

.header-nav a:hover {
  color: var(--primary);
}

.btn-outline {
  border: 1px solid var(--border);
  padding: 0.5rem 1rem !important;
  border-radius: 980px;
  color: var(--text-primary) !important;
}

.btn-outline:hover {
  background: var(--bg-light);
}

/* ========== LAYOUT ========== */
.dashboard-container {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 60px);
}

/* ========== SIDEBAR ========== */
.sidebar {
  background: var(--bg-light);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 3rem;
}

.sidebar-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.sidebar-section ul {
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all var(--transition);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.nav-link:hover {
  background: rgba(0, 113, 227, 0.1);
  color: var(--primary);
}

.nav-link.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

/* ========== MAIN CONTENT ========== */
.dashboard-main {
  padding: 3rem;
  overflow-y: auto;
}

.dashboard-section {
  margin-bottom: 4rem;
  animation: fadeIn 0.6s ease-out;
}

.section-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.section-header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ========== CONTENT GRID ========== */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 1000px) {
  .content-grid { grid-template-columns: 1fr; }
}

/* ========== TOOL CARDS ========== */
.tool-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.info-card {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.info-card h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.info-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.info-card ul {
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.info-card li {
  margin-bottom: 0.5rem;
}

/* ========== CHAT INTERFACE ========== */
.chat-interface {
  display: flex;
  flex-direction: column;
  height: 400px;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  margin-bottom: 0.75rem;
  animation: slideUp 0.4s ease-out;
}

.message.user {
  justify-content: flex-end;
}

.message.user::after {
  content: attr(data-role);
  background: var(--primary);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 0.95rem;
}

.message.ai::before {
  content: attr(data-role);
  background: white;
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  max-width: 80%;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 0.95rem;
}

.message {
  display: flex;
  width: 100%;
}

.message.user {
  justify-content: flex-end;
}

.message.ai {
  justify-content: flex-start;
}

.message.user > * {
  background: var(--primary);
  color: white;
}

.message.ai > * {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.message > * {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 0.95rem;
}

.typing {
  display: flex;
  gap: 4px;
  padding: 0.75rem 1rem;
}

.typing span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 0.8s ease-in-out infinite;
}

.typing span:nth-child(2) { animation-delay: 0.1s; }
.typing span:nth-child(3) { animation-delay: 0.2s; }

@keyframes pulse {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

.chat-input {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: white;
  border-top: 1px solid var(--border);
}

.chat-input textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  height: 50px;
}

.chat-input textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.btn-send {
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-send:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ========== UPLOAD AREA ========== */
.upload-box {
  padding: 1.5rem;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

.upload-area {
  border: 2px dashed var(--primary);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  background: white;
  cursor: pointer;
  transition: all var(--transition);
}

.upload-area:hover {
  background: var(--bg-light);
  border-color: var(--primary-dark);
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.upload-area p {
  color: var(--text-secondary);
  margin: 0.5rem 0;
}

.claim-input {
  padding: 1.5rem;
}

.claim-input textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  height: 100px;
  margin-bottom: 1rem;
}

.claim-input textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.claim-input .btn-send {
  width: 100%;
  padding: 0.75rem 1.5rem;
  height: auto;
}

/* ========== STEPS TIMELINE ========== */
.steps-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.step {
  background: white;
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  transition: all var(--transition);
}

.step:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  margin-bottom: 1rem;
}

.step h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.step p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========== METHODS GRID ========== */
.methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.method-card {
  background: white;
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  transition: all var(--transition);
}

.method-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.method-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.method-card h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.method-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ========== MATERIALS LIST ========== */
.materials-list {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.material-item {
  background: white;
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 12px;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  transition: all var(--transition);
}

.material-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

.material-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.material-item > div {
  flex: 1;
}

.material-item h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.material-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.btn-download {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-download:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1000px) {
  .dashboard-container { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .dashboard-main { padding: 2rem 1.5rem; }
  .section-header h1 { font-size: 1.8rem; }
}

@media (max-width: 600px) {
  .dashboard-main { padding: 1rem; }
  .section-header { padding-bottom: 1rem; }
  .steps-timeline { grid-template-columns: repeat(2, 1fr); }
  .methods-grid { grid-template-columns: 1fr; }
  .material-item { flex-direction: column; text-align: center; }
  .btn-download { width: 100%; }
}
