/* ==================================================
   COMPARISON PAGE STYLES - MOBILE FIRST
   ================================================== */

/* Comparison Hero */
.comparison-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.year-badge {
    display: inline-block;
    background: #10b981;
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 2rem;
    font-size: 1.6rem;
    font-weight: 600;
    margin-left: 1rem;
    vertical-align: middle;
}

.hero-subtitle {
    font-size: 2rem;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.6rem;
    color: #6b7280;
    margin-bottom: 3rem;
    line-height: 1.5;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 2rem 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    min-width: 140px;
}

.stat-number {
    font-size: 2.4rem;
    font-weight: 800;
    color: #10b981;
    margin-bottom: 0.5rem;
}

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

/* Usage Guide */
.usage-guide {
    padding: 4rem 0;
    background: #fafafa;
}

.guide-grid {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

.guide-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.guide-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

.guide-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 800;
    margin: 0 auto 2rem;
}

.guide-card h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.guide-card p {
    font-size: 1.4rem;
    color: #6b7280;
    line-height: 1.6;
}

/* Filter Section */
.filter-section {
    background: #f9fafb;
    padding: 2rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.filter-controls {
    display: grid;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #374151;
    font-size: 1.4rem;
}

.filter-select {
    padding: 1rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1.4rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.filter-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.filter-reset {
    padding: 0.8rem 1.5rem;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.3rem;
    transition: background 0.2s ease;
}

.filter-reset:hover {
    background: #4b5563;
}

/* Mobile-First Table Design */
.comparison-section {
    padding: 4rem 0;
    background: #fafafa;
}

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

.section-header .section-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.6rem;
    color: #6b7280;
    font-weight: 500;
}

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.results-count strong {
    color: #10b981;
    font-weight: 700;
}

.view-toggle {
    padding: 0.8rem 1.5rem;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle:hover {
    background: #e5e7eb;
}

.table-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin: 2rem 0;
    -webkit-overflow-scrolling: touch;
}

/* モバイル・デスクトップ統一テーブル表示 */
.comparison-table {
    width: 100%;
    display: table;
    border-collapse: collapse;
    font-size: 1.3rem;
    min-width: 900px;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.comparison-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 700;
    color: #1f2937;
    cursor: pointer;
    user-select: none;
    position: relative;
    border-bottom: 2px solid #e2e8f0;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.comparison-table th span {
    display: block;
    font-weight: 700;
}

.comparison-table th small {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: #6b7280;
    margin-top: 0.2rem;
}

.comparison-table tbody tr:hover {
    background: linear-gradient(135deg, #f0fdf4 0%, #f9fafb 100%);
}

.comparison-table .company-cell {
    font-weight: 700;
    color: #111827;
}

.comparison-table .spread-cell {
    color: #059669;
    font-weight: 700;
}

.comparison-table .cashback-cell {
    color: #dc2626;
    font-weight: 600;
}

.comparison-table .stars {
    font-size: 1.4rem;
}

.sort-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #9ca3af;
}

.comparison-cards {
    display: none; /* モバイルカード非表示、テーブル統一 */
}

.company-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

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

.company-card.featured {
    border: 2px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.company-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.company-name {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}


.rating-stars {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.company-details {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-row:last-child {
    border-bottom: none;
}

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

.detail-value {
    font-weight: 600;
    color: #111827;
    font-size: 1.3rem;
    text-align: right;
}

.spread-value {
    color: #10b981;
    font-weight: 700;
}

.cashback-value {
    color: #dc2626;
    font-weight: 700;
}

.company-actions {
    display: flex;
    gap: 1rem;
}

.btn-sm {
    padding: 0.8rem 1.5rem;
    font-size: 1.3rem;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    flex: 1;
    transition: all 0.2s ease;
}

.btn-outline {
    border: 2px solid #10b981;
    color: #10b981;
    background: transparent;
}

.btn-outline:hover {
    background: #10b981;
    color: white;
}

.btn-primary {
    background: #10b981;
    color: white;
    border: 2px solid #10b981;
}

.btn-primary:hover {
    background: #059669;
    border-color: #059669;
}

/* Loading State */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.no-results h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #374151;
}

.no-results p {
    font-size: 1.4rem;
    margin-bottom: 2rem;
}

.clear-filters-btn {
    padding: 1rem 2rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Tablet Responsive */
@media (min-width: 768px) {
    .hero-title {
        font-size: 4rem;
    }
    
    .year-badge {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 2.4rem;
    }
    
    .hero-stats {
        gap: 4rem;
    }
    
    .stat-item {
        min-width: 160px;
        padding: 2.5rem 2rem;
    }
    
    .guide-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
    
    .filter-controls {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-cards {
        grid-template-columns: repeat(2, 1fr);
        padding: 2rem;
        gap: 2rem;
    }
    
    .company-actions {
        gap: 0.5rem;
    }
    
    .btn-sm {
        padding: 0.6rem 1rem;
        font-size: 1.2rem;
    }
}

/* Desktop Responsive */
@media (min-width: 1024px) {
    .hero-title {
        font-size: 4.8rem;
    }
    
    .year-badge {
        font-size: 2rem;
        padding: 0.4rem 1.2rem;
    }
    
    .hero-subtitle {
        font-size: 2.8rem;
    }
    
    .hero-description {
        font-size: 1.8rem;
    }
    
    .hero-stats {
        gap: 5rem;
    }
    
    .stat-item {
        min-width: 180px;
        padding: 3rem 2.5rem;
    }
    
    .stat-number {
        font-size: 2.8rem;
    }
    
    .stat-label {
        font-size: 1.4rem;
    }
    
    .filter-controls {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* デスクトップ表示は統一スタイルを継承 */
    
    .comparison-table th,
    .comparison-table td {
        padding: 1.5rem 1.2rem;
        text-align: left;
        border-bottom: 1px solid #f3f4f6;
        vertical-align: middle;
    }
    
    .comparison-table th {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        font-weight: 700;
        color: #1f2937;
        cursor: pointer;
        user-select: none;
        position: relative;
        border-bottom: 2px solid #e2e8f0;
        transition: all 0.2s ease;
    }
    
    .comparison-table th:hover {
        background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    }
    
    .comparison-table th span {
        display: block;
        font-size: 1.4rem;
        font-weight: 700;
    }
    
    .comparison-table th small {
        display: block;
        font-size: 1.1rem;
        font-weight: 400;
        color: #6b7280;
        margin-top: 0.2rem;
    }
    
    .sort-icon {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.4rem;
        color: #9ca3af;
        transition: all 0.2s ease;
    }
    
    .sortable:hover .sort-icon {
        color: #10b981;
    }
    
    .sortable.asc .sort-icon {
        color: #10b981;
        transform: translateY(-50%) rotate(180deg);
    }
    
    .sortable.desc .sort-icon {
        color: #10b981;
        transform: translateY(-50%) rotate(0deg);
    }
    
    .comparison-table tbody tr {
        transition: all 0.2s ease;
    }
    
    .comparison-table tbody tr:hover {
        background: linear-gradient(135deg, #f0fdf4 0%, #f9fafb 100%);
        transform: scale(1.001);
    }
    
    .comparison-table .company-cell {
        font-weight: 700;
        color: #111827;
        font-size: 1.4rem;
    }
    
    .comparison-table .spread-cell {
        color: #059669;
        font-weight: 700;
        font-size: 1.4rem;
    }
    
    .comparison-table .cashback-cell {
        color: #dc2626;
        font-weight: 600;
        font-size: 1.3rem;
    }
    
    .comparison-table .action-cell {
        display: flex;
        gap: 0.8rem;
        justify-content: center;
    }
    
    .comparison-table td {
        font-size: 1.3rem;
        color: #374151;
    }
    
    .comparison-table .stars {
        font-size: 1.6rem;
    }
}

/* Summary Section */
.comparison-summary {
    background: #f9fafb;
    padding: 4rem 0;
    margin-top: 4rem;
}

.summary-grid {
    display: grid;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.summary-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.summary-card h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: #374151;
}

.winner {
    font-size: 1.8rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 0.5rem;
}

.winner-detail {
    font-size: 1.3rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}