/*
 * AWS SAP学習リソース - CloudFront HTTPSガイド専用CSS
 * ページ固有のレイアウト・セクション・コンポーネントスタイル
 */

/* ========================================
   メインコンテナ
   ======================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.4);
    overflow: hidden;
}


/* ========================================
   ページヘッダー
   ======================================== */

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #9333EA 100%);
    color: white;
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '🔒';
    position: absolute;
    font-size: 20em;
    opacity: 0.1;
    top: -50px;
    right: -50px;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.3em;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}


/* ========================================
   メインコンテンツエリア
   ======================================== */

.content {
    padding: 50px;
}


/* ========================================
   イントロセクション
   ======================================== */

.intro {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-radius: 15px;
    border-left: 6px solid #0284c7;
}

.intro h2 {
    color: #0c4a6e;
    font-size: 2.2em;
    margin-bottom: 20px;
}

.intro-text {
    font-size: 1.2em;
    color: #075985;
    line-height: 1.8;
}


/* ========================================
   たとえ話セクション
   ======================================== */

.analogy-section {
    background: linear-gradient(to bottom, #fef3c7 0%, #fde68a 100%);
    padding: 40px;
    border-radius: 20px;
    margin: 40px 0;
    border-left: 8px solid #CA8A04;
}

.analogy-title {
    color: #92400e;
    font-size: 2em;
    margin-bottom: 25px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.analogy-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.analogy-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.analogy-card h3 {
    color: #92400e;
    font-size: 1.5em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analogy-card p {
    color: #78350f;
    line-height: 1.8;
    font-size: 1.05em;
}


/* ========================================
   HTTPSハンドシェイクフロー
   ======================================== */

.handshake-flow {
    background: white;
    padding: 50px 30px;
    border-radius: 20px;
    margin: 50px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.flow-title {
    text-align: center;
    font-size: 2.5em;
    color: #1e293b;
    margin-bottom: 40px;
    font-weight: bold;
}

.flow-diagram {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.flow-step {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
}

.flow-step:nth-child(even) {
    flex-direction: row-reverse;
}

.flow-step::after {
    content: '↓';
    position: absolute;
    left: 50%;
    bottom: -30px;
    transform: translateX(-50%);
    font-size: 2em;
    color: #64748B;
}

.flow-step:last-child::after {
    content: '';
}

.flow-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    background: white;
    border: 5px solid;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.flow-step:nth-child(1) .flow-icon { border-color: #ef4444; background: #fee2e2; }
.flow-step:nth-child(2) .flow-icon { border-color: #EA580C; background: #ffedd5; }
.flow-step:nth-child(3) .flow-icon { border-color: #eab308; background: #fef9c3; }
.flow-step:nth-child(4) .flow-icon { border-color: #16A34A; background: #dcfce7; }
.flow-step:nth-child(5) .flow-icon { border-color: #0284C7; background: #cffafe; }
.flow-step:nth-child(6) .flow-icon { border-color: #8b5cf6; background: #ede9fe; }
.flow-step:nth-child(7) .flow-icon { border-color: #ec4899; background: #fce7f3; }

.flow-content {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin: 0 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-left: 6px solid;
}

.flow-step:nth-child(1) .flow-content { border-color: #ef4444; }
.flow-step:nth-child(2) .flow-content { border-color: #EA580C; }
.flow-step:nth-child(3) .flow-content { border-color: #eab308; }
.flow-step:nth-child(4) .flow-content { border-color: #16A34A; }
.flow-step:nth-child(5) .flow-content { border-color: #0284C7; }
.flow-step:nth-child(6) .flow-content { border-color: #8b5cf6; }
.flow-step:nth-child(7) .flow-content { border-color: #ec4899; }

.step-number {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.step-title {
    font-size: 1.5em;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 10px;
}

.step-description {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 15px;
}

.step-analogy {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    color: #64748b;
    font-style: italic;
    margin-top: 10px;
}


/* ========================================
   証明書チェーン
   ======================================== */

.certificate-chain {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: 40px;
    border-radius: 20px;
    margin: 50px 0;
    border-left: 8px solid #2563eb;
}

.chain-title {
    color: #1e40af;
    font-size: 2em;
    margin-bottom: 25px;
    text-align: center;
}

/* 証明書チェーンの説明文（inline style撤廃用） */
.certificate-intro-text {
    text-align: center;
    color: #1e40af;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.chain-diagram {
    max-width: 800px;
    margin: 0 auto;
}

.chain-level {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
}

.chain-level::after {
    content: '⬇️';
    position: absolute;
    left: 50%;
    bottom: -25px;
    transform: translateX(-50%);
    font-size: 1.5em;
}

.chain-level:last-child::after {
    content: '';
}

.chain-level h3 {
    color: #1e40af;
    font-size: 1.4em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chain-level p {
    color: #1e3a8a;
    line-height: 1.7;
}

.trust-badge {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 10px;
}


/* ========================================
   エラー比較セクション
   ======================================== */

.error-comparison {
    background: white;
    padding: 50px 30px;
    border-radius: 20px;
    margin: 50px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.error-title {
    text-align: center;
    font-size: 2.5em;
    color: #1e293b;
    margin-bottom: 40px;
    font-weight: bold;
}

.error-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.error-card {
    background: linear-gradient(to bottom, #fff 0%, #f8fafc 100%);
    border-radius: 15px;
    padding: 35px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-top: 6px solid;
}

.error-card:nth-child(1) { border-color: #ef4444; }
.error-card:nth-child(2) { border-color: #CA8A04; }

.error-code {
    font-size: 3em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}

.error-card:nth-child(1) .error-code { color: #ef4444; }
.error-card:nth-child(2) .error-code { color: #CA8A04; }

.error-name {
    font-size: 1.5em;
    font-weight: bold;
    color: #1e293b;
    text-align: center;
    margin-bottom: 20px;
}

.error-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.error-section h4 {
    color: #334155;
    font-size: 1.2em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-section p {
    color: #475569;
    line-height: 1.7;
}

.error-section ul {
    margin-left: 20px;
    margin-top: 10px;
}

.error-section li {
    color: #475569;
    line-height: 1.8;
    margin-bottom: 8px;
}

.analogy-box {
    background: linear-gradient(to right, #fef3c7 0%, #fde68a 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #CA8A04;
    margin-top: 15px;
}

.analogy-box strong {
    color: #92400e;
    display: block;
    margin-bottom: 8px;
}

.analogy-box p {
    color: #78350f;
}


/* ========================================
   トラブルシューティング
   ======================================== */

.troubleshooting {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 40px;
    border-radius: 20px;
    margin: 50px 0;
    border-left: 8px solid #16A34A;
}

.troubleshooting-title {
    color: #166534;
    font-size: 2em;
    margin-bottom: 30px;
    text-align: center;
}

.troubleshooting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.troubleshooting-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.troubleshooting-card h4 {
    color: #166534;
    font-size: 1.3em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.troubleshooting-card ul {
    margin-left: 20px;
}

.troubleshooting-card li {
    color: #166534;
    line-height: 1.8;
    margin-bottom: 8px;
}


/* ========================================
   Tipボックス
   ======================================== */

.tip-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
    border-left: 6px solid #CA8A04;
}

.tip-title {
    font-size: 1.4em;
    font-weight: bold;
    color: #92400e;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tip-content {
    color: #78350f;
    line-height: 1.8;
}


/* ========================================
   まとめセクション
   ======================================== */

.summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #9333EA 100%);
    color: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    margin-top: 50px;
}

.summary h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.summary-card {
    background: rgba(255,255,255,0.15);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.summary-card h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
}

.summary-card p {
    line-height: 1.7;
    font-size: 1.05em;
}

/* まとめフッターボックス（inline style撤廃用） */
.summary-footer-box {
    margin-top: 40px;
    padding: 30px;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.summary-footer-box p {
    font-size: 1.3em;
    line-height: 1.8;
}


/* ========================================
   リソース集に戻るボタン（inline style撤廃用）
   ======================================== */

.back-to-resources-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #dc7600;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-resources-btn:hover {
    background-color: #E68900;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 153, 0, 0.4);
}

.back-to-resources-btn:active {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}


/* ========================================
   モバイル対応
   ======================================== */

@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }

    .content {
        padding: 30px 20px;
    }

    .flow-step:nth-child(n) {
        flex-direction: column;
    }

    .flow-content {
        margin: 20px 0;
    }

    .error-grid {
        grid-template-columns: 1fr;
    }
}
