/* ============================================
   Tailwind CSS 完全チートシート - スタイルシート
   ============================================ */

/* リセット & ベーススタイル */
/* WordPress記事本文用: スコープを限定してテーマとの競合を回避 */
.tailwind-cheatsheet-container * {
    box-sizing: border-box;
}

:root {
    /* カラーパレット */
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary-color: #8b5cf6;
    --accent-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* WordPress記事本文用: コンテナクラスでスコープを限定 */
.tailwind-cheatsheet-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-color);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: fadeIn 0.5s ease-in;
}

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

/* ヘッダー */
.tailwind-cheatsheet-container header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tailwind-cheatsheet-container header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: movePattern 20s linear infinite;
}

@keyframes movePattern {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(30px, 30px);
    }
}

.tailwind-cheatsheet-container header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    animation: slideDown 0.6s ease-out;
}

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

.tailwind-cheatsheet-container .subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* 目次 */
.tailwind-cheatsheet-container .toc {
    background: var(--card-bg);
    padding: 30px 40px;
    border-bottom: 3px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.tailwind-cheatsheet-container .toc h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.tailwind-cheatsheet-container .toc ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0;
    margin: 0;
}

.tailwind-cheatsheet-container .toc li {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    border-radius: 25px;
    transition: all 0.3s ease;
}

.tailwind-cheatsheet-container .toc li:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tailwind-cheatsheet-container .toc a {
    display: block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tailwind-cheatsheet-container .toc a:hover {
    color: #f0f0f0;
}

/* セクション */
.tailwind-cheatsheet-container .section {
    padding: 40px;
    animation: fadeInUp 0.6s ease-out;
}

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

.tailwind-cheatsheet-container .section h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

.tailwind-cheatsheet-container .section h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100px;
    height: 3px;
    background: var(--secondary-color);
    animation: expandWidth 0.8s ease-out;
}

@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 100px;
    }
}

/* プロパティカード */
.tailwind-cheatsheet-container .prop-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tailwind-cheatsheet-container .prop-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: width 0.3s ease;
}

.tailwind-cheatsheet-container .prop-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tailwind-cheatsheet-container .prop-card:hover::before {
    width: 100%;
    opacity: 0.05;
}

.tailwind-cheatsheet-container .prop-card h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.tailwind-cheatsheet-container .syntax {
    background: #1e293b;
    color: #10b981;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    margin: 15px 0;
    overflow-x: auto;
    position: relative;
    z-index: 1;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tailwind-cheatsheet-container .syntax code {
    color: #10b981;
    background: transparent;
}

.tailwind-cheatsheet-container .description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

/* デモコンテナ */
.tailwind-cheatsheet-container .demo-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.tailwind-cheatsheet-container .demo-box {
    background: #f8fafc;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.tailwind-cheatsheet-container .demo-box:hover {
    border-color: var(--primary-color);
    background: #f1f5f9;
    transform: scale(1.02);
}

.tailwind-cheatsheet-container .demo-box.full-width {
    grid-column: 1 / -1;
}

.tailwind-cheatsheet-container .demo-box h4 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 1rem;
    text-align: center;
    font-weight: 600;
}

.tailwind-cheatsheet-container .demo-area {
    min-height: 80px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px;
}

/* コードブロック */
.tailwind-cheatsheet-container pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 20px;
    box-shadow: var(--shadow-md);
    position: relative;
}

.tailwind-cheatsheet-container pre code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.tailwind-cheatsheet-container pre::before {
    content: 'HTML/CSS';
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* 情報ボックス */
.tailwind-cheatsheet-container .info-box {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border-left: 5px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tailwind-cheatsheet-container .info-box p {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.tailwind-cheatsheet-container .info-box ul {
    margin-left: 20px;
    margin-top: 10px;
}

/* コード例 */
.tailwind-cheatsheet-container .code-example {
    background: #1e293b;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.tailwind-cheatsheet-container .code-label {
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 600;
}

.tailwind-cheatsheet-container .live-demo {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
}

/* 比較ボックス */
.tailwind-cheatsheet-container .comparison-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tailwind-cheatsheet-container .comparison-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    border: 2px solid var(--border-color);
}

.tailwind-cheatsheet-container .comparison-item h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* スペーシングテーブル */
.tailwind-cheatsheet-container .spacing-scale {
    margin-top: 25px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
}

.tailwind-cheatsheet-container .spacing-scale h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.tailwind-cheatsheet-container .spacing-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.tailwind-cheatsheet-container .spacing-table th,
.tailwind-cheatsheet-container .spacing-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.tailwind-cheatsheet-container .spacing-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.tailwind-cheatsheet-container .spacing-table tr:hover {
    background: #f1f5f9;
}

/* ブレークポイントテーブル */
.tailwind-cheatsheet-container .breakpoint-table {
    margin-top: 25px;
}

.tailwind-cheatsheet-container .responsive-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tailwind-cheatsheet-container .responsive-table th,
.tailwind-cheatsheet-container .responsive-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.tailwind-cheatsheet-container .responsive-table th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-weight: 600;
}

.tailwind-cheatsheet-container .responsive-table tr:hover {
    background: #f1f5f9;
}

.tailwind-cheatsheet-container .responsive-table code {
    background: #1e293b;
    color: #10b981;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* フッター */
.tailwind-cheatsheet-container footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    text-align: center;
    padding: 30px;
    font-size: 1.1rem;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .tailwind-cheatsheet-container {
        margin: 10px;
    }

    .tailwind-cheatsheet-container header h1 {
        font-size: 2rem;
    }

    .tailwind-cheatsheet-container .subtitle {
        font-size: 1rem;
    }

    .tailwind-cheatsheet-container .section {
        padding: 20px;
    }

    .tailwind-cheatsheet-container .section h2 {
        font-size: 1.8rem;
    }

    .tailwind-cheatsheet-container .prop-card {
        padding: 20px;
    }

    .tailwind-cheatsheet-container .demo-container {
        grid-template-columns: 1fr;
    }

    .tailwind-cheatsheet-container .toc ul {
        flex-direction: column;
    }

    .tailwind-cheatsheet-container .toc li {
        width: 100%;
    }
}

/* スクロールバーのスタイリング */
.tailwind-cheatsheet-container ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.tailwind-cheatsheet-container ::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.tailwind-cheatsheet-container ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

.tailwind-cheatsheet-container ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
}

/* アニメーション強化 */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
    .tailwind-cheatsheet-container *,
    .tailwind-cheatsheet-container *::before,
    .tailwind-cheatsheet-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 印刷スタイル */
@media print {
    .tailwind-cheatsheet-container {
        background: white;
        box-shadow: none;
    }

    .tailwind-cheatsheet-container .demo-box,
    .tailwind-cheatsheet-container .prop-card {
        break-inside: avoid;
    }
}

/* Tailwind CSSのクラスが適用される要素のスタイル調整 */
.tailwind-cheatsheet-container .space-y-2 > * + * {
    margin-top: 0.5rem;
}

.tailwind-cheatsheet-container .space-y-4 > * + * {
    margin-top: 1rem;
}

.tailwind-cheatsheet-container .space-x-4 > * + * {
    margin-left: 1rem;
}

