/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6f00;
    --secondary-color: #f57c00;
    --accent-color: #ffffff;
    --text-color: #212121;
    --light-bg: #fff8e1;
    --border-color: #ffccbc;
    --code-bg: #1e1e1e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #ff6f00 0%, #ff9800 100%);
    min-height: 100vh;
}

/* Header */
header {
    background: linear-gradient(135deg, #ff6f00 0%, #ff9800 100%);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    opacity: 0.95;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem 2rem;
}

/* Sections */
section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* Intro */
.intro p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #424242;
}

/* Parts Grid */
.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.part-card {
    background: linear-gradient(135deg, #fff3e0 0%, #ffecb3 100%);
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.part-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(255, 111, 0, 0.2);
}

.part-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.part-card p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.part-card ul {
    list-style: none;
    padding: 0;
}

.part-card li {
    margin: 0.5rem 0;
}

.part-card a {
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.part-card a:hover {
    background: rgba(255, 111, 0, 0.1);
    padding-left: 1rem;
}

.part-card a::before {
    content: "📄";
    margin-right: 0.5rem;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.info-card {
    background: linear-gradient(135deg, #fff3e0 0%, #ffffff 100%);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.info-card p {
    margin: 0.5rem 0;
}

.info-card strong {
    color: var(--primary-color);
    font-size: 1.5rem;
    display: block;
    margin: 0.5rem 0;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.tip-card {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.tip-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.tip-card p {
    color: #666;
    line-height: 1.6;
}

/* Resources */
.resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.resource-item {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.resource-item h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.resource-item ul {
    list-style: none;
    padding: 0;
}

.resource-item li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.resource-item li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Code Blocks */
.code-block {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
    border-left: 4px solid var(--primary-color);
}

.code-block pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-block code {
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.6;
    display: block;
    white-space: pre-wrap;
}

/* Japanese Text */
.japanese {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    font-size: 1.2rem;
    line-height: 2;
}

.furigana {
    ruby {
        ruby-position: over;
    }
    rt {
        font-size: 0.6em;
        color: #666;
    }
}

/* Key Points */
.key-points {
    list-style: none;
    padding: 0;
}

.key-points li {
    background: var(--light-bg);
    margin: 0.8rem 0;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.key-points li::before {
    content: "✓";
    position: absolute;
    left: 1rem;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Examples */
.example {
    background: #f5f5f5;
    padding: 1rem;
    margin: 1rem 0;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
}

.example-sentence {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.example-translation {
    color: #666;
    font-style: italic;
}

/* Navigation */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-nav a {
    background: linear-gradient(135deg, #ff6f00 0%, #ff9800 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.page-nav a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 111, 0, 0.3);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: white;
    background: rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem 1rem;
    }
    
    section {
        padding: 1.5rem;
    }
    
    .parts-grid,
    .info-grid,
    .tips-grid,
    .resource-list {
        grid-template-columns: 1fr;
    }
    
    .page-nav {
        flex-direction: column;
    }
}
