/* Marketplace Styles */

/* ========================================
   Compact Header (New Design)
   ======================================== */

.marketplace-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 56px;
}

.header-brand a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1f2937;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.header-brand i {
    font-size: 1.5rem;
    color: #667eea;
}

.brand-text {
    white-space: nowrap;
}

.header-search {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 6px 12px;
    gap: 8px;
    transition: all 0.2s;
}

.header-search:focus-within {
    background: #fff;
    box-shadow: 0 0 0 2px #667eea33;
}

.header-search i {
    color: #9ca3af;
    font-size: 14px;
}

.header-search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    min-width: 0;
}

.header-search input::placeholder {
    color: #9ca3af;
}

.search-submit {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit:hover {
    color: #5a67d8;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-filter {
    position: relative;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s;
}

.btn-filter:hover {
    background: #e5e7eb;
}

.btn-filter.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.filter-count {
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.header-link {
    color: #6b7280;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.header-link:hover {
    background: #f3f4f6;
    color: #374151;
}

.user-name {
    color: #6b7280;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-logout {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 10px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* ========================================
   Collapsible Filter Panel (New Design)
   ======================================== */

.filter-panel {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    max-height: 80px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.filter-panel.collapsed {
    max-height: 0;
    border-bottom: none;
}

.filter-panel .filter-row {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-panel .filter-select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #374151;
    cursor: pointer;
    min-width: 120px;
}

.filter-panel .filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px #667eea22;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s;
}

.filter-checkbox:hover {
    background: #f3f4f6;
}

.filter-checkbox input {
    accent-color: #667eea;
}

.btn-clear {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #f3f4f6;
    color: #374151;
}

/* ========================================
   Results Bar (New Design)
   ======================================== */

.results-bar {
    padding: 12px 0;
    font-size: 14px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.results-bar #results-count {
    font-weight: 500;
    color: #374151;
}

/* Header & Filter Panel - Mobile Responsive */
@media (max-width: 768px) {
    .marketplace-header {
        padding: 0 12px;
    }

    .header-container {
        height: 52px;
        gap: 8px;
    }

    .header-brand .brand-text {
        display: none;
    }

    .header-search {
        max-width: none;
        flex: 1;
    }

    .header-link {
        display: none;
    }

    .user-name {
        display: none;
    }

    .filter-panel .filter-row {
        padding: 12px;
        gap: 8px;
    }

    .filter-panel .filter-select {
        flex: 1;
        min-width: 100px;
    }

    .filter-checkbox {
        flex: 1;
        justify-content: center;
    }

    .results-bar {
        padding: 8px 0;
    }
}

@media (max-width: 480px) {
    .header-container {
        height: 48px;
        gap: 6px;
    }

    .header-search {
        padding: 4px 8px;
    }

    .btn-filter {
        padding: 6px 8px;
    }

    .btn-logout {
        padding: 4px 8px;
    }

    .filter-panel .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-panel .filter-select,
    .filter-checkbox,
    .btn-clear {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   New Card Structure Styles
   ======================================== */

/* Card Icon (new) - 控えめなグレー */
.card-icon {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    flex-shrink: 0;
    font-size: 1rem;
}

/* Card Header - パディング圧縮 */
.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.card-title {
    flex: 1;
    min-width: 0;
}

.card-status {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Card Body - パディング圧縮 */
.card-body {
    padding: 8px 12px;
    flex: 1;
}

.provider-desc {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer - 2段構造 */

/* 上段：統計情報（控えめ・圧縮） */
.card-footer-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #fafafa;
    border-top: 1px solid #f3f4f6;
    font-size: 11px;
    color: #9ca3af;
}

.card-footer-stats .stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-footer-stats .stat i {
    font-size: 11px;
    color: #9ca3af;
}

.card-footer-stats .stat span {
    color: #6b7280;
    font-weight: 500;
}

.card-footer-stats .stat-category {
    padding: 2px 6px;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

/* 下段：アクション（明確・圧縮） */
.card-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-top: 1px solid #f3f4f6;
}

.card-footer-actions .btn-detail,
.btn-detail {
    padding: 4px 10px;
    height: 30px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    white-space: nowrap;
}

.card-footer-actions .btn-detail:hover,
.btn-detail:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.card-footer-actions .btn-install,
.btn-install {
    padding: 4px 12px;
    height: 30px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: #667eea;
    color: white;
    white-space: nowrap;
}

.card-footer-actions .btn-install:hover,
.btn-install:hover {
    background: #5a67d8;
}

.card-footer-actions .btn-install.btn-danger,
.btn-install.btn-danger {
    background: #dc2626;
}

.card-footer-actions .btn-install.btn-danger:hover,
.btn-install.btn-danger:hover {
    background: #b91c1c;
}

/* 後方互換性のため旧クラスも維持 */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #fafafa;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #9ca3af;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat i {
    font-size: 11px;
}

.stat-category {
    padding: 2px 6px;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* Auth Badges (in card-status for non-installed) - フラット化 */
.auth-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
    border: none;
}

.auth-badge.auth-ok {
    background: #e0f2fe;
    color: #075985;
}

.auth-badge.auth-required {
    background: #fef3c7;
    color: #854d0e;
}

.auth-badge.auth-available {
    background: #e0f2fe;
    color: #075985;
}

/* ========================================
   Layout & Container
   ======================================== */

.marketplace-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* コンテナの幅をウィンドウサイズに連動 */
@media (min-width: 1400px) {
    .marketplace-container {
        max-width: 1320px;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .marketplace-container {
        max-width: 1140px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .marketplace-container {
        max-width: 960px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .marketplace-container {
        max-width: 720px;
    }
}

/* ========================================
   Hero Section
   ======================================== */

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.hero-content h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    font-weight: 400;
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    display: flex;
    background: white;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-btn {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6a4190 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

/* ========================================
   Filters Section
   ======================================== */

.filters-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
    margin-bottom: 1.5rem;
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.filters-section:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.filters-container {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

/* 中間サイズ（タブレット）での調整 */
@media (min-width: 768px) and (max-width: 991px) {
    .filters-container {
        gap: 1rem;
    }
    
    .filter-group {
        min-width: 140px;
        flex: 1 1 auto;
    }
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 160px;
}

.filter-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.filter-select:hover {
    border-color: #9ca3af;
}

/* ========================================
   Featured Section
   ======================================== */

.featured-section {
    margin-bottom: 2rem;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.featured-section:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.section-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #6b7280;
    font-size: 1rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1rem;
}

/* ========================================
   Advanced Filters
   ======================================== */

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
}

.filter-actions .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-actions .btn-outline {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    transition: all 0.3s ease;
}

.filter-actions .btn-outline:hover {
    background: #f3f4f6;
    border-color: #5a67d8;
    color: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.filter-actions .btn-outline:active {
    transform: scale(0.98);
}

.filter-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid transparent;
    color: white;
    transition: all 0.3s ease;
}

.filter-actions .btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.filter-actions .btn-primary:active {
    transform: scale(0.98);
}

/* ========================================
   Results Section
   ======================================== */

.results-section {
    margin-bottom: 3rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.results-count {
    color: #6b7280;
    font-size: 0.875rem;
}

/* ========================================
   Provider Grid
   ======================================== */

.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
    gap: 1.75rem;
    margin-bottom: 2rem;
    width: 100%;
    align-items: stretch;
}

/* 中間サイズ（タブレット）での調整 */
@media (min-width: 768px) and (max-width: 1023px) {
    .providers-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
        gap: 1.25rem;
    }
}

/* 小さいデスクトップでの調整 */
@media (min-width: 1024px) and (max-width: 1199px) {
    .providers-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
        gap: 1.25rem;
    }
}

/* ========================================
   Provider Card
   ======================================== */

.provider-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ホバー時のグラデーションライン - 削除（シンプルに） */
/*
.provider-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 1;
}

.provider-card:hover::before {
    opacity: 1;
}
*/

.provider-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border-color: rgba(102, 126, 234, 0.2);
}

.provider-card:active {
    transform: scale(0.98);
}

/* MCP ステータス別の左ボーダー（1px薄色） */
.provider-card[data-mcp-status="available"] {
    border-left: 1px solid #86efac;  /* 薄緑: MCP使用可能 */
}

.provider-card[data-mcp-status="pending"] {
    border-left: 1px solid #fde68a;  /* 薄黄: 要有効化 */
}

.provider-card[data-mcp-status="none"] {
    border-left: 1px solid #e5e7eb;  /* グレー: 未インストール */
}

.provider-card.featured-card {
    border: 1px solid #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.02) 0%, white 100%);
}

.provider-card.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
    border-color: #5a67d8;
}

.provider-header {
    padding: 1.25rem 1.25rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.provider-header-top {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.provider-icon {
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    flex-shrink: 0;
    font-size: 1.125rem;
}

.provider-info {
    flex: 1;
    min-width: 0;
}

.provider-name {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
    word-break: break-word;
}

.provider-author {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
    word-break: break-word;
}

.provider-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.stars {
    display: flex;
    gap: 0.125rem;
    align-items: center;
}

.star {
    color: #fbbf24;
    font-size: 0.8125rem;
}

.star.empty {
    color: #d1d5db;
}

.rating-text {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.provider-body {
    padding: 0 1.25rem 0.875rem;
    flex: 1;
}

.provider-description {
    color: #4b5563;
    font-size: 0.8125rem;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.provider-description:empty::before {
    content: '説明がありません';
    color: #9ca3af;
    font-style: italic;
}

.provider-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    min-height: 1.5rem;
}

.provider-tag {
    background: #f3f4f6;
    color: #4b5563;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    border: none;
}

/* タグ: +n 残り表示 */
.provider-tag.tag-more {
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 600;
}

/* タグ: カスタム（ユーザー作成）- フラット */
.provider-tag.tag-custom {
    background: #e5e7eb;
    color: #374151;
    font-weight: 600;
}

/* タグ: 認証タイプ - フラット */
.provider-tag.tag-auth {
    background: #e5e7eb;
    color: #374151;
    font-weight: 500;
}

.provider-footer {
    padding: 0.875rem 1.25rem 1.25rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.provider-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.install-count {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #6b7280;
    font-size: 0.75rem;
}

.install-count i {
    font-size: 0.875rem;
}

.install-text {
    font-weight: 500;
}

.provider-category {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #93c5fd;
}

/* レスポンシブ: タブレットサイズ（768px - 991px） */
@media (min-width: 768px) and (max-width: 991px) {
    .provider-footer {
        gap: 0.875rem;
        padding: 1rem 1.25rem 1.25rem;
    }
    
    .provider-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: center;
    }
    
    .provider-auth-status {
        padding: 0.625rem;
    }
    
    .provider-actions {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .provider-actions .btn {
        flex: 1;
        min-width: 0;
    }
}

.provider-auth-status .auth-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.provider-auth-status .badge {
    align-self: flex-start;
}

.provider-auth-status .auth-description {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
    word-break: break-word;
}

.provider-auth-status .auth-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

.provider-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.provider-actions .btn {
    flex: 1;
    min-height: 38px;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    text-align: center;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.provider-actions .btn i {
    font-size: 0.875rem;
}

/* ========================================
   States
   ======================================== */

.loading-state,
.error-state,
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-icon,
.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-state h3,
.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.error-state p,
.empty-state p {
    margin-bottom: 1.5rem;
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-info {
    color: #6b7280;
    font-size: 0.875rem;
}

/* ========================================
   Responsive Design
   ======================================== */

/* 中間サイズ（タブレット）での調整 */
@media (min-width: 769px) and (max-width: 991px) {
    .hero-section {
        padding: 2.5rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .search-container {
        max-width: 90%;
    }
    
    .featured-section {
        padding: 1.75rem;
    }
    
    .filters-section {
        padding: 1.25rem;
    }
    
    .provider-card {
        width: 100%;
    }
}

/* 小さいデスクトップでの調整 */
@media (min-width: 992px) and (max-width: 1199px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .providers-grid {
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .marketplace-container {
        padding: 0 0.75rem;
    }
    
    .hero-section {
        padding: 2rem 0;
        margin-bottom: 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-content p {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }
    
    .search-container {
        padding: 0 0.5rem;
    }
    
    .search-input {
        padding: 0.875rem 1.25rem;
        font-size: 16px; /* iOSでのズーム防止 */
    }
    
    .search-btn {
        padding: 0.875rem 1.25rem;
        min-width: 48px;
        min-height: 44px;
    }
    
    .featured-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-header p {
        font-size: 0.9rem;
    }
    
    .filters-section {
        padding: 1.25rem;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .filter-select {
        padding: 0.875rem 1rem;
        font-size: 16px; /* iOSでのズーム防止 */
        min-height: 44px;
    }
    
    .filter-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-actions .btn {
        width: 100%;
        padding: 0.875rem 1.25rem;
        min-height: 44px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .results-header h2 {
        font-size: 1.25rem;
    }
    
    .providers-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        max-width: 100%;
    }
    
    /* 縦長表示での改善 */
    .provider-card {
        width: 100%;
        max-width: 100%;
    }
    
    .provider-header {
        padding: 1rem 1rem 0.75rem;
        gap: 0.625rem;
    }
    
    .provider-header-top {
        gap: 0.75rem;
    }
    
    .provider-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .provider-name {
        font-size: 0.9375rem;
        line-height: 1.3;
    }
    
    .provider-author {
        font-size: 0.75rem;
    }
    
    .provider-rating {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    
    .provider-rating .stars {
        flex-wrap: wrap;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .provider-card {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    .provider-card:active {
        transform: scale(0.98);
    }
    
    @media (hover: none) {
        .provider-card:hover {
            transform: none;
        }
    }
    
    .provider-header {
        padding: 1.25rem 1.25rem 0.875rem;
    }
    
    .provider-icon {
        width: 40px;
        height: 40px;
    }
    
    .provider-name {
        font-size: 1rem;
    }
    
    .provider-author {
        font-size: 0.8125rem;
    }
    
    .provider-body {
        padding: 0 1rem 0.75rem;
    }
    
    .provider-description {
        font-size: 0.75rem;
        margin-bottom: 0.625rem;
    }
    
    .provider-footer {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        padding: 0.75rem 1rem 1rem;
    }
    
    .provider-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.625rem;
        align-items: center;
    }
    
    .provider-auth-status {
        padding: 0.625rem;
        margin: 0;
    }
    
    .provider-auth-status .auth-status {
        gap: 0.5rem;
    }
    
    .provider-auth-status .auth-description {
        font-size: 0.75rem;
        line-height: 1.5;
    }
    
    .provider-actions {
        width: 100%;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .provider-actions .btn {
        flex: 1;
        min-height: 40px;
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .pagination .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }
    
    .loading-state,
    .error-state,
    .empty-state {
        padding: 3rem 1.5rem;
    }
    
    .error-icon,
    .empty-icon {
        font-size: 2.5rem;
    }
    
    .error-state h3,
    .empty-state h3 {
        font-size: 1.1rem;
    }
    
    .error-state p,
    .empty-state p {
        font-size: 0.9rem;
    }
    
    .candidate-overlay-content,
    .adoption-history-content {
        width: 95%;
        max-width: none;
        margin: 5% auto;
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .candidate-header,
    .adoption-history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .close-btn {
        position: absolute;
        top: 1rem;
        right: 1rem;
        font-size: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1.25rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.25rem 1.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        min-height: 44px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* iOSでのズーム防止 */
        padding: 0.875rem;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .marketplace-container {
        padding: 0 0.5rem;
    }
    
    body {
        overflow-x: hidden;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    * {
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    .hero-section {
        padding: 1.5rem 0;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-content p {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .search-container {
        padding: 0 0.25rem;
    }
    
    .search-box {
        border-radius: 1rem;
    }
    
    .search-input {
        padding: 0.75rem 1rem;
        font-size: 16px; /* iOSでのズーム防止 */
    }
    
    .search-btn {
        padding: 0.75rem 1rem;
        min-width: 48px;
    }
    
    .featured-section {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .section-header h2 {
        font-size: 1.25rem;
    }
    
    .section-header p {
        font-size: 0.85rem;
    }
    
    .filters-section {
        padding: 1rem;
        border-radius: 0.5rem;
    }
    
    .filter-row {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .filter-group label {
        font-size: 0.8125rem;
    }
    
    .filter-select {
        padding: 0.75rem 0.875rem;
        font-size: 16px; /* iOSでのズーム防止 */
    }
    
    .filter-actions {
        padding-top: 1rem;
        margin-top: 0.75rem;
    }
    
    .filter-actions .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .results-header h2 {
        font-size: 1.1rem;
    }
    
    .results-count {
        font-size: 0.8125rem;
    }
    
    .providers-grid {
        gap: 1rem;
        max-width: 100%;
    }
    
    /* 縦長表示での改善（480px以下） */
    .provider-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .provider-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .provider-rating {
        width: 100%;
        margin-top: 0.5rem;
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .provider-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .provider-stats {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .provider-card {
        border-radius: 0.5rem;
    }
    
    .provider-header {
        padding: 0.875rem 0.875rem 0.625rem;
        gap: 0.5rem;
    }
    
    .provider-header-top {
        gap: 0.625rem;
    }
    
    .provider-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .provider-name {
        font-size: 0.875rem;
    }
    
    .provider-author {
        font-size: 0.6875rem;
    }
    
    .provider-body {
        padding: 0 0.875rem 0.625rem;
    }
    
    .provider-description {
        font-size: 0.6875rem;
        margin-bottom: 0.5rem;
    }
    
    .provider-tag {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }
    
    .provider-footer {
        flex-direction: column;
        gap: 0.625rem;
        padding: 0.625rem 0.875rem 0.875rem;
    }
    
    .provider-stats {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        gap: 0.5rem;
    }
    
    .provider-auth-status {
        padding: 0.5rem;
        margin: 0;
    }
    
    .provider-auth-status .auth-status {
        gap: 0.375rem;
    }
    
    .provider-auth-status .badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.4375rem;
    }
    
    .provider-auth-status .auth-description {
        font-size: 0.6875rem;
        line-height: 1.5;
    }
    
    .provider-actions {
        flex-direction: row;
        gap: 0.5rem;
        width: 100%;
    }
    
    .provider-actions .btn {
        flex: 1;
        min-height: 38px;
        padding: 0.5625rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .pagination {
        gap: 0.5rem;
    }
    
    .pagination .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .page-info {
        font-size: 0.8125rem;
    }
    
    .loading-state,
    .error-state,
    .empty-state {
        padding: 2.5rem 1rem;
    }
    
    .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }
    
    .error-icon,
    .empty-icon {
        font-size: 2rem;
    }
    
    .error-state h3,
    .empty-state h3 {
        font-size: 1rem;
    }
    
    .error-state p,
    .empty-state p {
        font-size: 0.875rem;
    }
    
    .candidate-overlay-content,
    .adoption-history-content {
        width: 98%;
        padding: 1.25rem;
        max-height: 90vh;
    }
    
    .candidate-header h3,
    .adoption-history-header h3 {
        font-size: 1.1rem;
    }
    
    .candidate-badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.5rem;
    }
    
    .score-breakdown h4 {
        font-size: 0.9375rem;
    }
    
    .score-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .score-label {
        width: auto;
    }
    
    .score-value {
        width: auto;
    }
    
    .score-explanation {
        margin-left: 0;
        font-size: 0.8125rem;
    }
    
    .candidate-actions {
        flex-direction: column;
        gap: 0.625rem;
    }
    
    .candidate-actions .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        min-height: 44px;
    }
    
    .adoption-history-body {
        margin-bottom: 1rem;
    }
    
    .history-section {
        margin-bottom: 1.5rem;
    }
    
    .history-section h4 {
        font-size: 0.9375rem;
    }
    
    .history-list,
    .audit-log-list {
        max-height: 250px;
    }
    
    .history-item,
    .audit-log-item {
        padding: 0.875rem;
    }
    
    .history-item-header,
    .audit-log-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .detail-label {
        width: auto;
    }
    
    .adoption-history-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .adoption-history-footer .btn {
        width: 100%;
        min-height: 44px;
    }
    
    .modal-content {
        width: 98%;
        margin: 1% auto;
        border-radius: 0.75rem;
    }
    
    .modal-header {
        padding: 1rem 1.25rem;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .close {
        font-size: 1.75rem;
    }
    
    .modal-body {
        padding: 1.25rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.375rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* iOSでのズーム防止 */
        padding: 0.75rem;
    }
    
    .form-group textarea {
        min-height: 80px;
    }
    
    .modal-footer {
        padding: 1rem 1.25rem;
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* ========================================
   Button States
   ======================================== */

.install-btn.installed {
    background: #10b981;
    color: white;
    border-color: #10b981;
    opacity: 0.8;
}

.install-btn.installed:hover {
    background: #059669;
    border-color: #059669;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.install-btn.installing {
    background: #6b7280;
    color: white;
    cursor: not-allowed;
    border-color: #6b7280;
    opacity: 0.7;
}

.install-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.view-details-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    font-weight: 600;
    cursor: pointer;
}

.view-details-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.install-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
}

.install-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

/* アンインストールボタン（赤色） */
.install-btn.btn-danger {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.install-btn.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.install-btn.btn-danger:active {
    background-color: #bd2130;
    border-color: #b21f2d;
    transform: translateY(0);
}

.install-btn.btn-danger:disabled {
    background-color: #dc3545;
    opacity: 0.65;
    cursor: not-allowed;
}

/* ========================================
   Animation
   ======================================== */

.provider-card {
    animation: fadeInUp 0.3s ease-out;
}

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

/* ========================================
   Provider Detail Page Styles
   ======================================== */

.provider-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.provider-detail-content {
    display: block;
}

/* Provider Header Section */
.provider-header-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.provider-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.provider-icon-large {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.provider-info {
    flex: 1;
}

.provider-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.provider-author {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0 0 1rem 0;
}

.provider-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.provider-category {
    background: #f3f4f6;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.provider-version {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.provider-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Provider Stats */
.provider-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    border-top: 1px solid #e5e7eb;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

/* Provider Content */
.provider-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.main-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.content-section {
    margin-bottom: 2rem;
}

.content-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f3f4f6;
}

.provider-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #374151;
    margin: 0;
}

/* Features List */
.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.feature-text {
    font-weight: 500;
    color: #374151;
}

/* Screenshots Gallery */
.screenshots-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.screenshot-item {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.screenshot-item:hover {
    transform: translateY(-4px);
}

.screenshot-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Reviews Section */
.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.rating-overview {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rating-stars {
    display: flex;
    gap: 0.25rem;
}

.rating-stars .star {
    color: #fbbf24;
    font-size: 1.2rem;
}

.rating-text {
    font-weight: 600;
    color: #374151;
}

.reviews-list {
    space-y: 1rem;
}

.review-item {
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.review-author {
    font-weight: 600;
    color: #1f2937;
}

.review-rating {
    display: flex;
    gap: 0.25rem;
}

.review-rating .star {
    color: #fbbf24;
    font-size: 1rem;
}

.review-text {
    color: #374151;
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.sidebar-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.installation-status {
    text-align: center;
    padding: 1rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-dot.installed {
    background: #10b981;
}

.status-dot.not-installed {
    background: #6b7280;
}

.provider-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.provider-info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.provider-info-list li:last-child {
    border-bottom: none;
}

.provider-info-list .label {
    font-weight: 500;
    color: #6b7280;
}

.provider-info-list .value {
    font-weight: 600;
    color: #1f2937;
}

/* Tags */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #f3f4f6;
    color: #374151;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Links */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #374151;
    transition: background-color 0.2s ease;
}

.link-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.link-icon {
    width: 20px;
    height: 20px;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .provider-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .provider-actions {
        width: 100%;
        justify-content: center;
    }
    
    .provider-content {
        grid-template-columns: 1fr;
    }
    
    .provider-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .features-list {
        grid-template-columns: 1fr;
    }
    
    .screenshots-gallery {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Modal Styles
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    border: 2px solid rgba(102, 126, 234, 0.1);
}

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

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1rem 1rem 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background-color: #f9fafb;
    border-radius: 0 0 1rem 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========================================
   Accessibility
   ======================================== */

.provider-card:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.search-input:focus,
.filter-select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ========================================
   Accessibility & Contrast Improvements
   ======================================== */

/* コントラスト比の改善 */
.hero-content p {
    color: rgba(255, 255, 255, 0.98); /* より明るい白でコントラスト向上 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.filter-group label {
    color: #1f2937 !important; /* より濃い色でコントラスト向上 */
    font-weight: 600;
}

.rating-text {
    color: #374151 !important; /* より濃い色でコントラスト向上 */
    font-weight: 500;
}

.provider-author {
    color: #4b5563 !important; /* より濃い色でコントラスト向上 */
}

.results-count {
    color: #374151 !important; /* より濃い色でコントラスト向上 */
    font-weight: 500;
}

.provider-tag {
    background: #e5e7eb !important; /* より濃い背景でコントラスト向上 */
    color: #1f2937 !important;
    border: 1px solid #d1d5db;
}

.provider-category {
    background: #bfdbfe !important; /* より濃い背景でコントラスト向上 */
    color: #1e3a8a !important; /* より濃い文字色 */
    border: 1px solid #93c5fd;
}

/* ========================================
   Dark Mode Support (Future Enhancement)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Dark mode styles would go here */
    /* Currently not implemented but prepared for future enhancement */
}

/* ========================================
   Scrollbar Styling
   ======================================== */

/* カスタムスクロールバー */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6a4190 100%);
}

/* Firefox用のスクロールバー */
* {
    scrollbar-width: thin;
    scrollbar-color: #667eea rgba(102, 126, 234, 0.05);
}

/* ========================================
   Provider Toggle Switch
   ======================================== */

.provider-toggle-container {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: #22c55e;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-label {
    font-size: 12px;
    color: #64748b;
    min-width: 32px;
    font-weight: 500;
}

.toggle-switch input:checked ~ .toggle-label {
    color: #22c55e;
}

/* 無効化されたProviderカード */
.provider-card.disabled {
    opacity: 0.6;
    filter: grayscale(30%);
}

.provider-card.disabled .provider-name {
    color: #94a3b8;
}

.provider-card.disabled::before {
    background: #94a3b8 !important;
}

/* ========================================
   Mobile Swipe Carousel
   ======================================== */

@media (max-width: 768px) {
    /* カルーセルコンテナ */
    .providers-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 0 !important;
        padding: 16px calc((100vw - 90%) / 2) !important;
        margin: 0 calc((100vw - 100%) / 2) !important;
    }

    /* スクロールバー非表示 */
    .providers-grid::-webkit-scrollbar {
        display: none;
    }

    .providers-grid {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* 各カードをフル幅でスナップ */
    .providers-grid .provider-card {
        flex: 0 0 88vw !important;
        max-width: 88vw !important;
        min-width: 88vw !important;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        margin: 0 8px !important;
    }

    /* カルーセルインジケーター */
    .carousel-indicators {
        display: flex;
        justify-content: center;
        gap: 8px;
        padding: 16px 0;
        flex-wrap: wrap;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #cbd5e1;
        border: none;
        padding: 0;
        transition: all 0.2s ease;
        cursor: pointer;
    }

    .carousel-dot:hover {
        background: #94a3b8;
    }

    .carousel-dot.active {
        background: #667eea;
        transform: scale(1.3);
    }

    /* カード番号表示 */
    .carousel-counter {
        text-align: center;
        font-size: 14px;
        color: #6b7280;
        padding: 8px 0;
        font-weight: 500;
    }

    /* フィルターセクションをスタック表示に */
    .filters-section {
        flex-direction: column;
        gap: 12px;
    }

    .filters-section .filter-group {
        width: 100%;
    }
}

/* 480px以下ではさらにコンパクト */
@media (max-width: 480px) {
    .providers-grid .provider-card {
        flex: 0 0 92vw !important;
        max-width: 92vw !important;
        min-width: 92vw !important;
        margin: 0 4px !important;
    }

    .carousel-dot {
        width: 8px;
        height: 8px;
    }
}
