/* 変数定義（デザインシステム） */
:root {
    /* カラーパレット */
    --color-bg: #f8fafc;
    /* slate-50 */
    --color-surface: #ffffff;
    --color-text-main: #0f172a;
    /* slate-900 */
    --color-text-muted: #64748b;
    /* slate-500 */
    --color-primary: #3b82f6;
    /* blue-500 */
    --color-primary-hover: #2563eb;
    /* blue-600 */
    --color-accent: #f97316;
    /* orange-500 */
    --color-border: #e2e8f0;
    /* slate-200 */

    /* 影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

    /* タイポグラフィ */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;

    /* レイアウト */
    --container-max-width: 1024px;
    --border-radius-card: 20px;
    --border-radius-tag: 9999px;

    /* トランジション */
    --transition-fast: 0.15s ease-in-out;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 共通設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* 背景の装飾（グラスモーフィズム風） */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: drift 20s infinite alternate ease-in-out;
}

.circle-1 {
    top: -10%;
    right: -5%;
    width: 50vw;
    height: 50vw;
    background-color: rgba(59, 130, 246, 0.15);
    /* primary */
}

.circle-2 {
    bottom: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background-color: rgba(249, 115, 22, 0.1);
    /* accent */
    animation-delay: -5s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-30px, 50px);
    }
}

/* レイアウトコンテナ */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ヘッダー */
.header {
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text-main);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

/* メインコンテンツ周り */
.main-content {
    flex: 1;
    padding-bottom: 5rem;
}

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

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-main);
}

/* アプリグリッド（カード一覧） */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* アプリカード */
.app-card {
    background-color: var(--color-surface);
    border-radius: var(--border-radius-card);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(59, 130, 246, 0.3);
}

/* カードのホバー用エフェクト（背景グラデーション） */
.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    opacity: 0;
    transition: var(--transition-base);
}

.app-card:hover::before {
    opacity: 1;
}

.app-card-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
    /* アイコンがない場合のフォールバックデザイン */
    background: linear-gradient(135deg, var(--color-primary), #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-main);
}

.app-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-tag);
    margin-top: 0.25rem;
    display: inline-block;
}

.status-active {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-development {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.app-description {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    flex-grow: 1;
    /* 内容が少ないカードでもフッターを下部に押し下げる */
}

/* タグ一覧 */
.app-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background-color: var(--color-bg);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.8rem;
    border-radius: var(--border-radius-tag);
    border: 1px solid var(--color-border);
    transition: var(--transition-fast);
}

.app-card:hover .tag {
    border-color: rgba(59, 130, 246, 0.2);
    background-color: rgba(59, 130, 246, 0.05);
    /* slightly primary */
    color: var(--color-primary);
}

/* カードのアクション部分 */
.app-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--color-border);
    padding-top: 1.25rem;
}

.action-text {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.action-icon {
    color: var(--color-primary);
    transition: transform var(--transition-fast);
}

.app-card:hover .action-icon {
    transform: translateX(4px);
}

/* 読み込み状態 */
.loading-state {
    color: var(--color-text-muted);
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
    font-weight: 500;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

/* フッター */
.footer {
    padding: 2.5rem 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--color-border);
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer-links .divider {
    color: var(--color-border);
}

.copyright {
    color: #94a3b8;
    /* slate-400 */
}

/* レスポンシブ対応 */
@media (max-width: 640px) {
    .header {
        padding: 2rem 0;
    }

    .logo {
        font-size: 2rem;
    }

    .app-card {
        padding: 1.5rem;
    }
}