:root {
    --color-primary: #3b82f6;
    --color-primary-600: #2563eb;
    --color-secondary: #1a1a1a;
    --color-tertiary: #2a2a2a;

    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    
    --color-success: #10b981;
    --color-success-100: #d1fae5;
    --color-success-200: #a7f3d0;
    --color-success-700: #047857;
    
    --color-error: #ef4444;
    --color-error-100: #fee2e2;
    --color-error-200: #fecaca;
    --color-error-700: #b91c1c;
    
    --color-warning: #f59e0b;
    --color-warning-100: #fef3c7;
    --color-warning-200: #fed7aa;
    --color-warning-700: #d97706;
    
    --color-info: #3b82f6;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    
    --sidebar-width: 260px;
    --header-height: 64px;
    
    --z-index-dropdown: 1000;
    --z-index-overlay: 1001;
    --z-index-sidebar: 1002;
    --z-index-modal: 1200;
    --z-index-notification: 1300;
    
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    --gradient-dark: linear-gradient(135deg, #30303d 0%, #191919 100%);
    --gradient-danger: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    
    --animation-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --animation-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    
    --blur-sm: blur(4px);
    --blur-md: blur(8px);
    --blur-lg: blur(16px);
}

/* Dark mode - invert light colors */
[data-theme="dark"] {
    --color-white: #111827;
    --color-gray-50: #1f2937;
    --color-gray-100: #374151;
    --color-gray-200: #4b5563;
    --color-gray-300: #6b7280;
    --color-gray-400: #9ca3af;
    --color-gray-500: #d1d5db;
    --color-gray-600: #e5e7eb;
    --color-gray-700: #f3f4f6;
    --color-gray-800: #f9fafb;
    --color-gray-900: #ffffff;

    --shadow-sm: 0 1px 2px 0 rgba(255, 255, 255, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(255, 255, 255, 0.1), 0 2px 4px -1px rgba(255, 255, 255, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(255, 255, 255, 0.1), 0 4px 6px -2px rgba(255, 255, 255, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(255, 255, 255, 0.1), 0 10px 10px -5px rgba(255, 255, 255, 0.04);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] * {
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-gray-900);
    background-color: var(--color-gray-50);
}

::selection {
    background: rgba(102, 126, 234, 0.2);
    color: var(--color-primary);
}

*:focus-visible {
    outline: 2px solid var(--gradient-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
    transition: outline var(--transition-fast);
}

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

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

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.8; 
    }
}

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

.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.main-container {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: var(--spacing-2xl);
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.page-title {
    margin-bottom: var(--spacing-2xl);
}

.page-title h2 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-900);
    margin-bottom: var(--spacing-xs);
}

.page-subtitle {
    font-size: var(--font-size-base);
    color: var(--color-gray-500);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--color-gray-100);
    color: var(--color-gray-700);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

.btn-secondary:hover::after {
    left: 100%;
}

.btn-secondary:hover {
    background: var(--color-gray-200);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background: var(--gradient-danger);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    transition: var(--transition-base);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-text {
    color: var(--color-gray-600);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-weight: var(--font-weight-medium);
    transition: var(--transition-base);
}

.btn-text:hover {
    color: var(--color-primary);
}

.btn-text.danger {
    color: var(--color-error);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: var(--color-white);
}

/* スピナーを削除 - プログレスバーのみ使用 */

.loading-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-sm);
}

.loading-message {
    font-size: var(--font-size-base);
    opacity: 0.8;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    margin: var(--spacing-xl) auto 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--color-white);
    width: 0;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-index-overlay);
}

.mobile-overlay.active {
    display: block;
}

.noscript-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-error);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl);
}

.noscript-warning h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-md);
}

@media (max-width: 768px) {
    .main-container {
        margin-left: 0;
    }
    
    .main-content {
        padding: var(--spacing-lg);
    }
    
    .page-title h2 {
        font-size: var(--font-size-2xl);
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: var(--spacing-md);
    }
    
    .page-title h2 {
        font-size: var(--font-size-xl);
    }
}