/* ========================================
   Labora - 統合スタイルシート
   Inspired by Gig Share Dashboard UI
   ======================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* リセット & 基本設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* カスタムプロパティ（CSS変数） */
:root {
  /* メインカラー - ミントグリーン系 */
  --primary: #5ebd8c;
  --primary-dark: #4aa876;
  --primary-light: #7fd4a8;
  --primary-gradient: linear-gradient(135deg, #6bbd99 0%, #5ebd8c 100%);
  
  /* セカンダリカラー - ネイビー/パープル系 */
  --secondary: #4f46b0;
  --secondary-dark: #3d3691;
  --secondary-light: #6b63c7;
  --secondary-gradient: linear-gradient(135deg, #5b54b8 0%, #4f46b0 100%);
  
  /* アクセントカラー */
  --accent: #f5a623;
  --accent-light: #ffc966;
  --accent-coral: #ff6b6b;
  --accent-orange: #ff8c42;
  
  /* 成功・警告・エラー */
  --success: #5ebd8c;
  --success-light: #7fd4a8;
  --warning: #f5a623;
  --error: #e53e3e;
  
  /* テキストカラー */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-light: #d1d5db;
  
  /* 背景カラー - ダッシュボード風 */
  --bg-main: #f0f2f5;
  --bg-primary: #ffffff;
  --bg-secondary: #f7f8fa;
  --bg-tertiary: #eef0f4;
  --bg-sidebar: #4a5568;
  --bg-card: #ffffff;
  
  /* ボーダー */
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  
  /* シャドウ - より柔らかく */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
  
  /* 角丸 - より大きく */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* トランジション */
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;
  --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ベースフォント */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
    'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* スムーススクロール */
html {
  scroll-behavior: smooth;
}

/* ========================================
   共通レイアウト
   ======================================== */

/* コンテナ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-xl {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ページコンテナ */
.page-container {
  min-height: 100vh;
  padding: 24px;
  background: var(--bg-main);
}

/* メインコンテンツラッパー */
.main-wrapper {
  background: var(--bg-primary);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  margin: 0 auto;
  max-width: 1400px;
}

/* ========================================
   ヘッダー
   ======================================== */

.header {
  background: var(--bg-primary);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.logo::before {
  content: '';
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
}

.logo:hover {
  opacity: 0.8;
}

/* ページタイトル */
.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title .badge {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

/* 検索バー */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  gap: 8px;
  min-width: 280px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(94, 189, 140, 0.15);
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text-secondary);
  width: 100%;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

/* ヘッダーアクション */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}

.icon-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  padding: 8px 16px;
  border-radius: var(--radius-md);
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(94, 189, 140, 0.1);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(94, 189, 140, 0.1);
  font-weight: 600;
}

/* ========================================
   ボタン
   ======================================== */

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* プライマリボタン */
.btn-primary {
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* セカンダリボタン */
.btn-secondary {
  background: var(--secondary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* アウトラインボタン */
.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 11px 23px;
}

.btn-outline:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

/* ========================================
   カード共通
   ======================================== */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-content {
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* カラーカード（フォルダ風） */
.card-green {
  background: linear-gradient(135deg, #6bbd99 0%, #5ebd8c 100%);
  color: white;
  border: none;
}

.card-green .card-title,
.card-green .card-subtitle {
  color: white;
}

.card-purple {
  background: linear-gradient(135deg, #5b54b8 0%, #4f46b0 100%);
  color: white;
  border: none;
}

.card-purple .card-title,
.card-purple .card-subtitle {
  color: white;
}

.card-number {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 24px;
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.card-subtitle {
  font-size: 13px;
  opacity: 0.8;
}

/* グリッド */
.grid {
  display: grid;
  gap: 24px;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ========================================
   ヒーローセクション（ダッシュボード風）
   ======================================== */

.hero-section {
  background: var(--bg-primary);
  padding: 40px;
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
}

.hero-content {
  max-width: 600px;
}

.hero-section h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-section h2,
.hero-section p {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.6;
}

/* 新規追加ボタン */
.add-btn {
  width: 120px;
  height: 120px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  color: var(--text-muted);
  font-size: 32px;
}

.add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(94, 189, 140, 0.05);
}

/* ========================================
   セクション共通
   ======================================== */

.section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* セクションボックス */
.section-box {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

/* ========================================
   ストレージ/統計カード
   ======================================== */

.stats-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.stats-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* ドーナツチャート風 */
.donut-chart {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(
    var(--secondary) 0deg 50deg,
    var(--primary) 50deg 120deg,
    var(--accent) 120deg 170deg,
    var(--bg-tertiary) 170deg 360deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto 24px;
}

.donut-chart::before {
  content: '';
  width: 100px;
  height: 100px;
  background: var(--bg-card);
  border-radius: 50%;
  position: absolute;
}

.donut-chart .percentage {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

/* 統計凡例 */
.stats-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.documents { background: var(--accent); }
.legend-dot.images { background: var(--secondary); }
.legend-dot.videos { background: var(--primary); }
.legend-dot.free { background: var(--bg-tertiary); }

/* ========================================
   ファイルリスト
   ======================================== */

.file-list {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.file-list h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.file-item:last-child {
  border-bottom: none;
}

.file-item:hover {
  background: var(--bg-secondary);
  margin: 0 -12px;
  padding: 12px;
  border-radius: var(--radius-md);
}

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 18px;
}

.file-icon.psd { background: #e8f5e9; color: var(--primary); }
.file-icon.jpg { background: #e3f2fd; color: var(--secondary); }
.file-icon.pdf { background: #ffebee; color: var(--error); }
.file-icon.zip { background: #fce4ec; color: #e91e63; }

.file-info {
  flex: 1;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.file-users {
  display: flex;
  align-items: center;
}

.file-users .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  margin-left: -8px;
  background: var(--bg-tertiary);
}

.file-users .avatar:first-child {
  margin-left: 0;
}

.file-users .more {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: -8px;
}

.file-date {
  font-size: 13px;
  color: var(--text-muted);
}

/* ========================================
   フィルタータブ
   ======================================== */

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-tab {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ========================================
   アラート・バッジ
   ======================================== */

.alert {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  margin: 16px 0;
  font-size: 14px;
  font-weight: 500;
}

.alert-success {
  background: rgba(94, 189, 140, 0.1);
  color: var(--primary-dark);
  border: 1px solid rgba(94, 189, 140, 0.2);
}

.alert-info {
  background: rgba(79, 70, 176, 0.1);
  color: var(--secondary);
  border: 1px solid rgba(79, 70, 176, 0.2);
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.badge-primary {
  background: var(--primary);
  color: white;
}

.badge-secondary {
  background: var(--secondary);
  color: white;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* ========================================
   CTA セクション
   ======================================== */

.cta-section {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  padding: 48px;
  text-align: center;
  border-radius: var(--radius-xl);
  margin: 32px 0;
  border: 1px solid var(--border-light);
}

.cta-content {
  max-width: 500px;
  margin: 0 auto;
}

.cta-section h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.cta-section p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ========================================
   フッター
   ======================================== */

footer {
  background: var(--bg-sidebar);
  color: white;
  padding: 32px;
  text-align: center;
  margin-top: 48px;
  border-radius: var(--radius-xl);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

footer a {
  color: var(--primary-light);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ========================================
   アニメーション
   ======================================== */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeInUp 0.4s ease-out forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }

/* ========================================
   ユーティリティクラス
   ======================================== */

/* 表示/非表示 */
.hidden { display: none !important; }
.block { display: block !important; }
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }

/* フレックス */
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
.gap-6 { gap: 24px !important; }

/* テキスト配置 */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

/* マージン */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.mt-5 { margin-top: 24px !important; }
.mt-6 { margin-top: 32px !important; }
.mt-8 { margin-top: 48px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-5 { margin-bottom: 24px !important; }
.mb-6 { margin-bottom: 32px !important; }
.mb-8 { margin-bottom: 48px !important; }

/* パディング */
.p-0 { padding: 0 !important; }
.p-2 { padding: 8px !important; }
.p-3 { padding: 12px !important; }
.p-4 { padding: 16px !important; }
.p-5 { padding: 24px !important; }
.p-6 { padding: 32px !important; }

/* ========================================
   レスポンシブ
   ======================================== */

@media (max-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .page-container {
    padding: 16px;
  }
  
  .main-wrapper {
    padding: 20px;
    border-radius: var(--radius-xl);
  }
  
  .header-container {
    padding: 0 16px;
  }
  
  .search-bar {
    min-width: 200px;
  }
  
  .nav-links {
    gap: 12px;
  }
  
  .hero-section {
    padding: 24px;
  }
  
  .hero-section h1 {
    font-size: 24px;
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  .section-box {
    padding: 16px;
  }
  
  .stats-card,
  .file-list {
    padding: 16px;
  }
  
  .cta-section {
    padding: 32px 20px;
  }
}

@media (max-width: 480px) {
  .nav-links {
    display: none;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .search-bar {
    display: none;
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }
  
  .filter-tab {
    flex-shrink: 0;
  }
}

/* ========================================
   印刷用スタイル
   ======================================== */

@media print {
  .header,
  .nav-links,
  .btn,
  .filter-tabs,
  footer {
    display: none !important;
  }
  
  body {
    background: white;
    font-size: 12pt;
  }
  
  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
