﻿/* ================================================================================
 * ファイル名: app/assets/stylesheets/application.css
 * 目的: ベーススタイル（フォント・リセット・アニメーション・SVGサイズ・汎用コンポーネント）
 * ================================================================================
 *
 * 【リファクタリング基準】CSSファイル用（コメント行は行数カウントから除外）
 * ----------------------------------------------------------------
 * 現在の実コード行数: 約300行（コメント除く）
 * 判定: ✅ 完璧（500行未満）
 * ----------------------------------------------------------------
 * 基準（CSSファイル専用）:
 *   1. 500行未満 → 完璧 ✅
 *   2. 800行未満 → 問題なし ✅
 *   3. 1200行未満 → 注意喚起。リファクタリング要検討 ⚠️
 *   4. 1200行以上 → リファクタリング必須 🚨
 *
 * 【Phase 2 分割】2026-02-18
 * このファイルから以下を分割しました:
 *   - theme_variables.css: CSS変数定義（:root, data-theme）
 *   - layout.css: レイアウト構造（メインコンテナ・サイドバー・ヘッダー・ツールバー）
 *   - luxury_components.css: ラグジュアリーテーマコンポーネント
 * ================================================================================
 *
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

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

/* SVG Flag Icons for consistent cross-platform display */
.luxury-flag-svg, .luxury-flag-svg-small {
  display: inline-block;
  vertical-align: middle;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Base Reset & Improvements */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  line-height: 1.6;
  overflow-x: hidden;
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* Enhanced Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes rotate360 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes gradient-xy {
  0%, 100% {
    transform: translate(0%, 0%);
  }
  25% {
    transform: translate(100%, 0%);
  }
  50% {
    transform: translate(100%, 100%);
  }
  75% {
    transform: translate(0%, 100%);
  }
}

/* SVG アイコンサイズ制御 - 拡大問題の恒久対策 */
/* 全SVGの最大サイズ制御 */
svg {
  max-width: 64px !important;
  max-height: 64px !important;
  flex-shrink: 0 !important;
}

/* サイズクラス別の確定な制御 */
.w-3.h-3 svg, .w-3 svg, .h-3 svg {
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
}

.w-3\.5.h-3\.5 svg, .w-3\.5 svg, .h-3\.5 svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
}

.w-4.h-4 svg, .w-4 svg, .h-4 svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

.w-5.h-5 svg, .w-5 svg, .h-5 svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
}

.w-6.h-6 svg, .w-6 svg, .h-6 svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
}

.w-8.h-8 svg, .w-8 svg, .h-8 svg {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
}

.w-10.h-10 svg, .w-10 svg, .h-10 svg {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
}

.w-12.h-12 svg, .w-12 svg, .h-12 svg {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
}

.w-16.h-16 svg, .w-16 svg, .h-16 svg {
  width: 64px !important;
  height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
}

/* Modern Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn:hover:before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* Glass Card Components */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
  padding: var(--space-xl);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow), var(--shadow-2xl);
}

.dark-glass-card {
  background: var(--dark-glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--dark-glass-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3D Tilt Effect */
.tilt-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease-out;
}

.tilt-3d:hover {
  transform: rotateX(5deg) rotateY(5deg) scale(1.02);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-xy 4s ease infinite;
}

/* Neon Glow Effect */
.neon-glow {
  box-shadow:
    0 0 5px var(--primary),
    0 0 10px var(--primary),
    0 0 15px var(--primary),
    0 0 20px var(--primary);
  animation: pulse 2s infinite;
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-primary);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: rotate360 1s linear infinite;
}

/* Floating Elements */
.float {
  animation: float 3s ease-in-out infinite;
}

.float:nth-child(2n) {
  animation-delay: -1s;
}

.float:nth-child(3n) {
  animation-delay: -2s;
}

/* Interactive Elements */
.interactive {
  cursor: pointer;
  transition: all 0.2s ease;
}

.interactive:hover {
  transform: scale(1.05);
}

.interactive:active {
  transform: scale(0.95);
}

/* Status Indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-online {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

.status-busy {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

.status-offline {
  background: #6b7280;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-surface);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-surface-active);
  border-radius: 4px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-surface-active);
}

/* Selection Styles */
::selection {
  background: var(--primary);
  color: white;
}

::-moz-selection {
  background: var(--primary);
  color: white;
}

/* Focus Styles */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Responsive Design Helpers */
@media (max-width: 768px) {
  .glass-card {
    padding: var(--space-lg);
  }

  .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8rem;
  }
}

/* Print Styles */
@media print {
  .glass-morphism,
  .dark-glass {
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .gradient-text {
    -webkit-text-fill-color: initial !important;
    background: none !important;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.8);
    --dark-glass-bg: rgba(0, 0, 0, 0.95);
    --dark-glass-border: rgba(255, 255, 255, 0.8);
  }
}

/* Dark Mode Preference */
@media (prefers-color-scheme: dark) {
  :root {
    --glass-bg: rgba(0, 0, 0, 0.15);
    --glass-border: rgba(255, 255, 255, 0.1);
    --dark-glass-bg: rgba(0, 0, 0, 0.3);
  }
}
