/* 
 * GoogleCloud道場 - style.css
 * Design: Material Design Dark Mode
 */

 :root {
    /* Colors - Light Mode */
    --bg-color: #f0f4f8;
    --surface-color: #ffffff;
    --primary-color: #4285f4;
    --success-color: #34a853;
    --error-color: #ea4335;
    --text-primary: #1a1a2e;
    --text-secondary: #5f6368;
    --border-color: #dadce0;

    /* Spacing & Shapes */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --header-height: 64px;
    --nav-bottom-height: 72px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--nav-bottom-height) + 20px);
}

/* --- Layout --- */
.content {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.logo span {
    margin-left: 0;
    font-weight: 700;
    transition: transform 0.2s ease;
    display: inline-block;
}

.logo span:hover {
    transform: scale(1.2) translateY(-2px);
}

/* 虹色 - 各文字に異なる色 */
.logo .r1  { color: #EA4335; } /* G - Red */
.logo .r2  { color: #FF6D00; } /* o - Orange */
.logo .r3  { color: #FBBC04; } /* o - Yellow */
.logo .r4  { color: #34A853; } /* g - Green */
.logo .r5  { color: #4285F4; } /* l - Blue */
.logo .r6  { color: #A142F4; } /* e - Purple */
.logo .r7  { color: #EA4335; } /* C - Red */
.logo .r8  { color: #FF6D00; } /* l - Orange */
.logo .r9  { color: #FBBC04; } /* o - Yellow */
.logo .r10 { color: #34A853; } /* u - Green */
.logo .r11 { color: #4285F4; } /* d - Blue */
.logo .r12 { color: #A142F4; } /* 道 - Purple */
.logo .r13 { color: #E91E90; } /* 場 - Pink */

.icon-button {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.icon-button:active {
    background-color: rgba(0, 0, 0, 0.05);
}

/* --- Progress Bar --- */
.progress-section {
    margin-bottom: 24px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #34a853);
    border-radius: 3px;
    transition: width 0.4s ease-out;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-item {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 0;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.tab-item.active {
    color: var(--primary-color);
}

.tab-item:active {
    background-color: rgba(66, 133, 244, 0.1);
}

/* --- Cards --- */
.card {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.badge {
    background-color: rgba(66, 133, 244, 0.2);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
}

.category {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.question-text {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 24px;
}

/* --- Buttons/Choices --- */
.choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-choice {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-choice:hover {
    background-color: #f1f5ff;
    border-color: var(--primary-color);
}

.btn-choice:active {
    transform: scale(0.98);
}

.btn-choice.correct {
    border-color: var(--success-color);
    background-color: rgba(52, 168, 83, 0.1);
    color: var(--success-color);
}

.btn-choice.incorrect {
    border-color: var(--error-color);
    background-color: rgba(234, 67, 53, 0.1);
    color: var(--error-color);
}

/* --- Feedback --- */
.feedback {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.875rem;
    animation: fadeIn 0.3s ease-out;
}

.result-correct {
    background-color: rgba(52, 168, 83, 0.1);
    color: #1e7e34;
}

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

/* --- Score / Result Card --- */
.score-card {
    text-align: center;
}

.result-summary {
    display: flex;
    justify-content: space-around;
    margin: 24px 0;
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: var(--radius-md);
}

.result-item {
    display: flex;
    flex-direction: column;
}

.result-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-status-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    background-color: #f8f9fa;
}

.result-status-box.pass {
    background-color: rgba(52, 168, 83, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.result-status-box.fail {
    background-color: rgba(234, 67, 53, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.result-status-box .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 8px;
}

#result-status-text {
    font-size: 1.5rem;
    font-weight: 700;
}

/* 分野別分析 */
.category-analysis {
    animation: fadeIn 0.8s ease forwards;
}

.analysis-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.analysis-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8125rem;
}

.analysis-category {
    font-weight: 500;
    color: var(--text-primary);
}

.analysis-rate {
    font-weight: 700;
}

.analysis-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.analysis-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.analysis-fill.high { background-color: var(--success-color); }
.analysis-fill.mid { background-color: var(--primary-color); }
.analysis-fill.low { background-color: var(--error-color); }

/* --- Bottom Nav --- */
.nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-bottom-height);
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s;
    width: 25%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    font-family: inherit;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item .material-symbols-outlined {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 0.625rem;
    font-weight: 500;
}

/* --- Utilities --- */
.hidden {
    display: none;
}

/* Responsive adjustments for larger screens */
@media (min-width: 600px) {
    .content {
        padding: 32px 16px;
    }
    .header-container {
        padding: 0 32px;
    }
    .card {
        padding: 32px;
    }
}
