/* ========================================
   汎用UIコンポーネント
   薬学生ポータルサイト - components.css
   作成日: 2025-07-17
   ======================================== */

/* ========================================
   レイアウトコンポーネント
   ======================================== */

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 32px;
    }
}

/* グリッドシステム */
.grid {
    display: grid;
    gap: 24px;
    width: 100%;
}

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

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

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

/* ========================================
   ボタンコンポーネント
   ======================================== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 48px;
    min-width: 140px;
}

/* プライマリボタンの改善 */
.button-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 
        0 4px 14px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(37, 99, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.button-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* サービスごとのボタン色 */
[data-service="okusuri"] .button-primary {
    background: linear-gradient(135deg, var(--service-okusuri) 0%, #047857 100%);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

[data-service="okusuri"] .button-primary:hover {
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

[data-service="timer"] .button-primary {
    background: linear-gradient(135deg, var(--service-timer) 0%, #b91c1c 100%);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

[data-service="timer"] .button-primary:hover {
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

[data-service="game"] .button-primary {
    background: linear-gradient(135deg, var(--service-game) 0%, #d97706 100%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

[data-service="game"] .button-primary:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* ボタン内の矢印アイコン */
.button-arrow {
    transition: transform 0.3s ease;
}

.button:hover .button-arrow {
    transform: translateX(4px);
}

/* モバイル対応 */
@media (max-width: 767px) {
    .button {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   カードコンポーネント
   ======================================== */

/* カード共通スタイル更新 */
.service-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 上部のカラーバー太く */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;  /* 4px → 6px */
    background: var(--service-color, #3498db);
    transition: height 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* サービス別カラーと背景パターン */
.service-card[data-service="okusuri"] {
    --service-color: var(--service-okusuri);
    background: 
        linear-gradient(to bottom, rgba(5, 150, 105, 0.03) 0%, white 100%);
}

.service-card[data-service="timer"] {
    --service-color: var(--service-timer);
    background: 
        linear-gradient(to bottom, rgba(220, 38, 38, 0.03) 0%, white 100%);
}

.service-card[data-service="game"] {
    --service-color: var(--service-game);
    background: 
        linear-gradient(to bottom, rgba(245, 158, 11, 0.03) 0%, white 100%);
}

/* アイコンを大きく、色を付ける */
.service-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
    color: var(--service-color);
    opacity: 0.9;
}

/* サービス名 */
.service-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #2c3e50;
}

.service-subtitle {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* サービス説明 */
.service-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #5d6d7e;
    margin-bottom: 24px;
}

/* 機能リスト */
.service-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #34495e;
}

.feature-icon {
    color: var(--service-color);
    font-weight: 700;
    font-size: 1.1rem;
}

/* 利用シーン */
.service-scene {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: auto;
    margin-bottom: 24px;
}

.scene-icon {
    color: #7f8c8d;
    flex-shrink: 0;
}

.scene-text {
    font-size: 0.875rem;
    color: #5d6d7e;
    margin: 0;
}

/* ========================================
   セクションコンポーネント
   ======================================== */

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.section-desc {
    font-size: 1.125rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .section-title {
        font-size: 2rem;
    }
    
    .section-desc {
        font-size: 1rem;
    }
}

/* ========================================
   アコーディオンコンポーネント
   ======================================== */

.updates-accordion {
    margin-top: 32px;
}

.accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 24px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #495057;
}

.accordion-toggle:hover {
    background: #e9ecef;
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.updates-accordion[open] .accordion-icon {
    transform: rotate(180deg);
}

/* ========================================
   更新アイテムコンポーネント
   ======================================== */

.update-item {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.update-item:last-child {
    border-bottom: none;
}

.update-item:hover {
    background: #f8f9fa;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.update-date {
    font-size: 0.875rem;
    color: #6c757d;
    min-width: 100px;
    font-weight: 500;
}

.update-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* お知らせタグをカラフルに */
.update-tag {
    display: inline-block;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    align-self: flex-start;
}

/* タグの色分け（新カラーパレット対応） */
.tag-okusuri {
    background: rgba(5, 150, 105, 0.1);
    color: var(--service-okusuri);
}

.tag-timer {
    background: rgba(220, 38, 38, 0.1);
    color: var(--service-timer);
}

.tag-game {
    background: rgba(245, 158, 11, 0.1);
    color: var(--service-game);
}

.update-text {
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   アニメーションクラス
   ======================================== */

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

/* スクロールアニメーション用 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   ユーティリティクラス
   ======================================== */

/* テキスト配置 */
.text-center { text-align: center; }

/* 表示制御 */
.hidden { display: none; }
.visible { display: block; }

/* フォーカス状態を明確に */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}