/**
 * ShareQL - Liquid Glass Design System
 * Apple風の洗練されたリキッドガラスデザイン
 * iOS 26インスパイア
 */

/* ===== CSS Variables ===== */
:root {
    /* カラーパレット - モノクロ基調 */
    --glass-white: rgba(255, 255, 255, 0.72);
    --glass-white-solid: rgba(255, 255, 255, 0.92);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-border-subtle: rgba(0, 0, 0, 0.04);
    --glass-shadow: rgba(0, 0, 0, 0.08);
    --glass-shadow-lg: rgba(0, 0, 0, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.8);
    
    /* テキストカラー */
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #aeaeb2;
    --text-quaternary: #c7c7cc;
    
    /* アクセントカラー（控えめに使用） */
    --accent-blue: #007aff;
    --accent-green: #34c759;
    --accent-red: #ff3b30;
    
    /* 背景 */
    --bg-primary: #fbfbfd;
    --bg-secondary: #f5f5f7;
    --bg-mesh-1: rgba(199, 210, 254, 0.15);
    --bg-mesh-2: rgba(254, 202, 202, 0.08);
    --bg-mesh-3: rgba(167, 243, 208, 0.08);
    
    /* タイポグラフィ */
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    
    /* スペーシング */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-2xl: 40px;
    
    /* トランジション */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.5;
    letter-spacing: -0.01em;
    overflow-x: hidden;
}

/* ===== Mesh Gradient Background ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 20%, var(--bg-mesh-1), transparent),
        radial-gradient(ellipse 60% 40% at 80% 80%, var(--bg-mesh-2), transparent),
        radial-gradient(ellipse 50% 30% at 50% 50%, var(--bg-mesh-3), transparent);
    pointer-events: none;
    z-index: -1;
}

/* ===== Liquid Glass Card ===== */
.glass-card {
    background: var(--glass-white);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 0 0 1px var(--glass-border-subtle),
        0 4px 24px var(--glass-shadow),
        0 12px 48px var(--glass-shadow),
        inset 0 1px 0 var(--glass-highlight);
    position: relative;
    overflow: hidden;
    transition: 
        transform 0.4s var(--ease-out-expo),
        box-shadow 0.4s var(--ease-out-expo);
}

/* リキッドガラスの光沢効果 */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    pointer-events: none;
    border-radius: inherit;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 0 1px var(--glass-border-subtle),
        0 8px 32px var(--glass-shadow-lg),
        0 24px 64px var(--glass-shadow),
        inset 0 1px 0 var(--glass-highlight);
}

/* ===== Glass Morphism - Softer variant ===== */
.glass-morphism {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

/* ===== Glass Input ===== */
.glass-input {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.04),
        0 1px 0 rgba(255, 255, 255, 0.8);
    transition: 
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.04),
        0 0 0 4px rgba(0, 0, 0, 0.03);
    outline: none;
}

.glass-input::placeholder {
    color: var(--text-tertiary);
}

/* ===== Glass Button ===== */
.glass-button {
    background: var(--glass-white-solid);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.06),
        0 4px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: 
        transform 0.2s var(--ease-out-expo),
        box-shadow 0.2s ease,
        background 0.2s ease;
    position: relative;
    overflow: hidden;
}

.glass-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.6) 0%,
        transparent 50%
    );
    pointer-events: none;
}

.glass-button:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.glass-button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Primary Button */
.glass-button-primary {
    background: #1d1d1f !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1);
    position: relative;
}

.glass-button-primary::before {
    display: none !important;
}

.glass-button-primary svg {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

.glass-button-primary:hover {
    background: #000000 !important;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 12px 32px rgba(0, 0, 0, 0.15);
}

/* ===== Character Mascot (Mikulu) ===== */
.mascot-container {
    position: relative;
    display: inline-block;
}

.mascot-glow {
    position: absolute;
    inset: -20%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.4) 30%,
        transparent 70%
    );
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.6s var(--ease-out-expo);
    pointer-events: none;
}

.mascot-container:hover .mascot-glow {
    opacity: 1;
}

.mascot-image {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.12));
    transition: 
        transform 0.6s var(--ease-out-expo),
        filter 0.6s var(--ease-out-expo);
}

.mascot-container:hover .mascot-image {
    transform: scale(1.05) translateY(-4px);
    filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.15));
}

/* ===== Float Animation - Refined ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(0.5deg);
    }
    50% {
        transform: translateY(-4px) rotate(0deg);
    }
    75% {
        transform: translateY(-10px) rotate(-0.5deg);
    }
}

.float-animation {
    animation: float 6s var(--ease-out-quart) infinite;
}

/* ===== Fade In Animation ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s var(--ease-out-expo) forwards;
    opacity: 0;
}

/* ===== Scale In Animation ===== */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.5s var(--ease-out-expo) forwards;
    opacity: 0;
}

/* ===== Blur In Animation ===== */
@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

.animate-blur-in {
    animation: blurIn 0.6s var(--ease-out-expo) forwards;
    opacity: 0;
}

/* ===== Shimmer Effect ===== */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.animate-shimmer {
    animation: shimmer 2.5s ease-in-out infinite;
}

/* ===== Pulse Glow ===== */
@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

.animate-pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* ===== Typography ===== */
.text-display {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.text-headline {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.text-body {
    font-family: var(--font-body);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

.text-caption {
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.4;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.text-mono {
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}

/* ===== Drop Zone States ===== */
.drop-zone {
    transition: 
        transform 0.3s var(--ease-out-expo),
        box-shadow 0.3s var(--ease-out-expo),
        border-color 0.3s ease,
        background 0.3s ease;
}

.drop-zone.drag-over {
    transform: scale(1.01);
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 
        0 0 0 1px var(--glass-border-subtle),
        0 12px 48px rgba(0, 0, 0, 0.12),
        0 24px 80px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 var(--glass-highlight);
}

/* ===== Progress Bar ===== */
.progress-container {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    background: linear-gradient(
        90deg,
        var(--text-secondary) 0%,
        var(--text-primary) 100%
    );
    border-radius: 100px;
    position: relative;
    transition: width 0.3s var(--ease-out-expo);
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ===== File Item Card ===== */
.file-item {
    transition: 
        transform 0.3s var(--ease-out-expo),
        box-shadow 0.3s var(--ease-out-expo);
}

.file-item:hover {
    transform: translateX(4px);
}

/* ===== Custom Scrollbar ===== */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 100px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Firefox */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

/* ===== Focus States ===== */
:focus-visible {
    outline: 2px solid var(--text-tertiary);
    outline-offset: 2px;
}

/* ===== Selection ===== */
::selection {
    background: rgba(0, 0, 0, 0.08);
}

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.badge-success {
    background: rgba(52, 199, 89, 0.1);
    color: #248a3d;
    border-color: rgba(52, 199, 89, 0.2);
}

.badge-warning {
    background: rgba(255, 149, 0, 0.1);
    color: #c93400;
    border-color: rgba(255, 149, 0, 0.2);
}

/* ===== Divider ===== */
.divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.06) 20%,
        rgba(0, 0, 0, 0.06) 80%,
        transparent 100%
    );
}

/* ===== Icon Button ===== */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: 
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s var(--ease-out-expo);
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #000000;
}

.icon-btn:active {
    transform: scale(0.95);
}

/* ===== Tooltip ===== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 0.5rem 0.75rem;
    background: var(--text-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 
        opacity 0.2s ease,
        transform 0.2s var(--ease-out-expo);
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    :root {
        --radius-lg: 20px;
        --radius-xl: 28px;
        --radius-2xl: 32px;
    }
    
    .glass-card {
        backdrop-filter: blur(24px) saturate(150%);
        -webkit-backdrop-filter: blur(24px) saturate(150%);
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .float-animation {
        animation: none;
    }
}

/* ===== Print ===== */
@media print {
    .glass-card,
    .glass-button,
    .glass-input {
        background: white;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        border: 1px solid #e5e5e5;
    }
}

/* ===== Splash Text Animation (Minecraft風) ===== */
@keyframes splashPop {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-5deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) rotate(2deg);
    }
    70% {
        transform: scale(0.95) rotate(-1deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes splashWiggle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.02) rotate(0.5deg);
    }
    75% {
        transform: scale(0.98) rotate(-0.5deg);
    }
}

.splash-text {
    display: inline-block;
    animation: 
        splashPop 0.6s var(--ease-spring) forwards,
        splashWiggle 3s ease-in-out 0.6s infinite;
    transform-origin: center center;
}

