/* GPD WIN5 公式デザイン再現 CSS */

/* パフォーマンス最適化: Font Awesome font-display */
@font-face {
    font-family: "Font Awesome 6 Free";
    font-style: normal;
    font-weight: 900;
    font-display: swap; /* FOUTを防ぎ、フォント読み込みを最適化 */
}

/* 公式カラー定義 */
:root {
    --gpd-yellow: #fff22a;
    --gpd-black: #000000;
    --gpd-white: #FFFFFF;
    --gpd-magenta: #c93eff;
}

/* ベースフォント設定 */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--gpd-yellow);
    color: var(--gpd-black);
    line-height: 1.4;
    overflow-x: hidden; /* 横スクロールを防ぐ */
}

/* カスタムロゴサイズクラス */
.w-20 {
    width: 5rem; /* 80px */
}

.h-8 {
    height: 2rem; /* 32px */
}

.w-32 {
    width: 8rem; /* 128px */
}

.w-40 {
    width: 10rem; /* 160px */
}

/* デスクトップロゴ拡大用サイズ */
.w-30 {
    width: 7.5rem !important; /* 120px */
}

.h-12 {
    height: 3rem !important; /* 48px */
}

.w-40 {
    width: 10rem !important; /* 160px */
}

.h-16 {
    height: 4rem !important; /* 64px */
}

/* レスポンシブロゴサイズの強制適用 */
@media (min-width: 768px) and (max-width: 1023px) {
    .md\:flex img[alt*="Logo"] {
        width: 120px !important;
        height: 48px !important;
    }
}

@media (min-width: 1024px) {
    .lg\:w-40 {
        width: 160px !important;
    }
    .lg\:h-16 {
        height: 64px !important;
    }
}

/* モバイルちらつき防止のための初期状態 */
@media (max-width: 768px) {
    /* グリッドセクションの初期非表示（JavaScript読み込み前） */
    section:nth-of-type(2) {
        visibility: visible;
    }
    
    /* JavaScript読み込み完了まで特定要素を安定化 */
    .grid.grid-cols-1 {
        opacity: 1;
        transition: opacity 0.3s ease;
    }
    
    /* モバイル安定化クラス */
    .mobile-stabilized {
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: all 0.3s ease;
    }
    
    /* ページ読み込み時の安定化 */
    body:not(.js-loaded) .grid {
        opacity: 1;
        visibility: visible;
    }
    
    /* 重要な要素のちらつき防止 */
    .gpd-card, .gpd-spec, table {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    /* JavaScript読み込み後に適用 */
    body.js-loaded .gpd-card,
    body.js-loaded .gpd-spec,
    body.js-loaded table {
        transition: all 0.8s ease;
    }
}

/* 横スクロール防止のための全体設定 */
html {
    overflow-x: hidden;
}

/* すべての要素の最大幅を画面幅に制限 */
* {
    max-width: 100vw;
    box-sizing: border-box;
}

/* 公式スタイルのタイトル */
.gpd-title {
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 8rem);
    letter-spacing: -0.02em;
    line-height: 0.9;
}

/* 公式スタイルのサブタイトル */
.gpd-subtitle {
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 2.5rem);
    letter-spacing: -0.01em;
}

/* 公式スタイルのセクションタイトル */
.gpd-section-title {
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 2rem;
}

/* 公式スタイルのカード */
.gpd-card {
    background-color: var(--gpd-black);
    color: var(--gpd-yellow);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.gpd-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* 公式スタイルのボタン */
.gpd-btn-primary {
    background-color: var(--gpd-black);
    color: var(--gpd-yellow);
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
}

.gpd-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.gpd-btn-secondary {
    background-color: transparent;
    color: var(--gpd-black);
    border: 2px solid var(--gpd-black);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gpd-btn-secondary:hover {
    background-color: var(--gpd-black);
    color: var(--gpd-yellow);
}

/* 公式スタイルのテーブル */
.gpd-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--gpd-black);
    color: var(--gpd-yellow);
    border-radius: 12px;
    overflow: hidden;
}

.gpd-table thead {
    background-color: var(--gpd-yellow);
    color: var(--gpd-black);
}

.gpd-table th,
.gpd-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 0, 0.2);
}

.gpd-table th {
    font-weight: 700;
    text-align: center;
}

.gpd-table tbody tr:last-child td {
    border-bottom: none;
}

/* 公式スタイルのスペック表示 */
.gpd-spec {
    background-color: var(--gpd-black);
    color: var(--gpd-yellow);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1rem;
}

.gpd-spec-title {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.gpd-spec-value {
    font-weight: 900;
    font-size: 2rem;
    color: var(--gpd-yellow);
}

.gpd-spec-description {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 公式スタイルのハイライト */
.gpd-highlight {
    background-color: var(--gpd-black);
    color: var(--gpd-yellow);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
}

/* 公式スタイルのバッジ */
.gpd-badge {
    background-color: #ef4444;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    position: absolute;
    top: -8px;
    right: -8px;
}

/* フォーム要素の公式スタイル */
.gpd-form-input {
    background-color: var(--gpd-black);
    border: 1px solid var(--gpd-yellow);
    color: var(--gpd-yellow);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    width: 100%;
    font-size: 1rem;
}

.gpd-form-input:focus {
    outline: none;
    border-color: var(--gpd-yellow);
    box-shadow: 0 0 0 2px rgba(255, 255, 0, 0.2);
}

.gpd-form-input::placeholder {
    color: rgba(255, 255, 0, 0.6);
}

.gpd-form-label {
    color: var(--gpd-yellow);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .gpd-title {
        font-size: 3rem;
    }
    
    .gpd-subtitle {
        font-size: 1.2rem;
    }
    
    .gpd-section-title {
        font-size: 2rem;
    }
    
    .gpd-card {
        padding: 1.5rem;
    }
    
    .gpd-table th,
    .gpd-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .gpd-spec {
        padding: 1rem;
    }
    
    .gpd-spec-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .gpd-title {
        font-size: 2.5rem;
    }
    
    .gpd-subtitle {
        font-size: 1rem;
    }
    
    .gpd-section-title {
        font-size: 1.8rem;
    }
    
    .gpd-table {
        font-size: 0.8rem;
    }
    
    .gpd-table th,
    .gpd-table td {
        padding: 0.5rem 0.25rem;
    }
}

/* アニメーション効果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.8s ease-out;
}

/* スクロール効果 - モバイルちらつき防止 */
.scroll-animate {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease;
}

/* JavaScript読み込み完了後に適用されるクラス */
body.js-loaded .scroll-animate {
    opacity: 0;
    transform: translateY(30px);
}

body.js-loaded .scroll-animate.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* 公式風のグラデーション効果 */
.gpd-gradient {
    background: linear-gradient(135deg, var(--gpd-yellow) 0%, #ffff66 50%, var(--gpd-yellow) 100%);
}

/* パフォーマンス比較チャート */
.performance-bar {
    background: linear-gradient(90deg, var(--gpd-black) 0%, #333 100%);
    color: var(--gpd-yellow);
    height: 40px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    margin: 0.5rem 0;
    position: relative;
    overflow: hidden;
}

.performance-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 0, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* GPD WIN5 商品画像表示 */
.gpd-win5-hero-image {
    background-image: url('/GPD WIN5/imgi_15_11443928.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.gpd-win5-hero-image .bg-gradient-to-br {
    background: transparent;
}

/* 画像が読み込めない場合のフォールバック */
.gpd-win5-hero-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/GPD WIN5/imgi_15_11443928.png') center/contain no-repeat;
    z-index: 1;
}

.gpd-win5-hero-image > div {
    position: relative;
    z-index: 2;
}

/* 印刷用スタイル */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .gpd-card,
    .gpd-highlight,
    .gpd-spec {
        background: white !important;
        color: black !important;
        border: 1px solid black !important;
    }
    
    .gpd-btn-primary,
    .gpd-btn-secondary {
        display: none !important;
    }
}

/* 固定ナビゲーションバー */
.gpd-navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    border-bottom: 2px solid var(--gpd-yellow);
}

.gpd-navigation.scrolled {
    background: rgba(0, 0, 0, 0.98);
    box-shadow: 0 2px 20px rgba(255, 242, 42, 0.1);
}

.gpd-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gpd-nav-logo {
    color: var(--gpd-yellow);
    font-weight: 900;
    font-size: 1.5rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.gpd-nav-logo:hover {
    color: var(--gpd-magenta);
}

.gpd-nav-menu {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.gpd-nav-item {
    margin: 0;
}

.gpd-nav-link {
    color: var(--gpd-yellow);
    text-decoration: none;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1.2;
}

.gpd-nav-link:hover {
    background-color: var(--gpd-yellow);
    color: var(--gpd-black);
    transform: translateY(-1px);
}

.gpd-nav-link:active {
    transform: translateY(0);
}

.gpd-nav-link.active {
    background-color: var(--gpd-magenta);
    color: white;
}

/* お問い合わせメールアイコン */
.gpd-contact-email {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gpd-yellow);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 2px solid var(--gpd-yellow);
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.gpd-contact-email:hover {
    background-color: var(--gpd-yellow);
    color: var(--gpd-black);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 242, 42, 0.3);
}

/* モバイルメニュートグル */
.gpd-mobile-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.25rem;
    border: none;
    background: none;
}

.gpd-mobile-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--gpd-yellow);
    margin: 2px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.gpd-mobile-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.gpd-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.gpd-mobile-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .gpd-nav-menu {
        gap: 0.2rem;
    }
    
    .gpd-nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem;
    }
    
    .gpd-contact-email {
        font-size: 0.8rem;
        padding: 0.4rem 0.7rem;
        margin-left: 0.3rem;
    }
}

@media (max-width: 1024px) {
    .gpd-nav-menu {
        gap: 0.15rem;
    }
    
    .gpd-nav-link {
        font-size: 0.75rem;
        padding: 0.35rem 0.4rem;
    }
    
    .gpd-contact-email {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
        margin-left: 0.2rem;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .gpd-mobile-toggle {
        display: flex;
    }
    
    .gpd-nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        padding: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border-bottom: 2px solid var(--gpd-yellow);
    }
    
    .gpd-nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .gpd-nav-item {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .gpd-nav-link {
        display: block;
        padding: 0.75rem 1rem;
        text-align: center;
        border: 1px solid var(--gpd-yellow);
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
    
    .gpd-contact-email {
        margin: 1rem 0 0 0;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .gpd-nav-logo {
        font-size: 1.4rem; /* 1.2rem から 1.4rem に拡大 */
    }
    
    .gpd-nav-link {
        font-size: 0.9rem;
    }
}

/* より大きな画面（タブレット）でもナビロゴを調整 */
@media (min-width: 481px) and (max-width: 768px) {
    .gpd-nav-logo {
        font-size: 1.6rem;
    }
}

/* ナビゲーション表示のためのボディマージン */
body {
    padding-top: 60px;
}

/* コンテンツセキュリティポリシーの準備 */
.safe-content {
    content-security-policy: "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';";
}

/* アクセシビリティ改善 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* フォーカス表示の改善 */
*:focus {
    outline: 2px solid var(--gpd-yellow);
    outline-offset: 2px;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .gpd-card {
        border: 2px solid var(--gpd-yellow);
    }
    
    .gpd-table {
        border: 2px solid var(--gpd-yellow);
    }
}

/* 視差効果軽減設定 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* パフォーマンス最適化 */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* クリティカルリソースのプリロード */
.hero-image {
    will-change: transform;
}

/* GPUアクセラレーションの最適化 */
.gpd-card,
.gpd-navigation,
.scroll-animate {
    will-change: transform;
    transform: translateZ(0);
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    :root {
        --gpd-yellow: #fff22a;
        --gpd-black: #000000;
        --gpd-white: #1a1a1a;
    }
}

/* スクリーンリーダーサポート */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* キーボードナビゲーションの改善 */
.gpd-nav-link:focus,
.gpd-btn-primary:focus,
.gpd-btn-secondary:focus {
    outline: 3px solid var(--gpd-yellow);
    outline-offset: 2px;
    background-color: var(--gpd-yellow);
    color: var(--gpd-black);
}

/* コントラスト比の改善 */
@media (min-contrast: 3) {
    .gpd-card {
        border: 1px solid var(--gpd-yellow);
    }
}

/* セキュリティ対策 */
.user-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* エラー状態の表示 */
.error-boundary {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    color: #991b1b;
    font-family: monospace;
    font-size: 0.875rem;
}

/* ローディング状態 */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--gpd-yellow);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}