/* 共通CSS - ポータル共通デザイン */

:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f5f5;
    --border-color: #e0e0e0;
    --text-color: #333;
    --menu-bg: #2c3e50;
    --menu-hover: #34495e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
    font-size: 16px; /* デフォルト（タブレット）サイズ */
}

/* ヘッダー */
.header {
    background: var(--menu-bg);
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* ヘッダー下の余白を狭くして、ヘッダーとコンテンツの間隔を詰める */
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    position: relative;
}

.header .home-btn {
    position: static;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 10px;
}

.header .home-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.header .home-btn i {
    font-size: 24px;
}

.header-title {
    flex: 1;
    text-align: center;
    margin: 0;
    font-size: 1.0em;
    color: white;
    text-decoration: none;
    border-bottom: none;
}

.header-title a {
    color: white;
    text-decoration: none;
}

.header-title a:hover {
    text-decoration: underline;
}

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

/* 通知バッジスタイル */
.notification-btn-wrapper {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--menu-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* バッジ更新時のアニメーション */
.unread-badge {
    display: inline-block;
    transition: transform 0.2s ease;
}

.unread-badge.badge-updated {
    animation: badgeShake 0.3s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes badgeShake {
    0%, 100% {
        transform: translateX(0) scale(1);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px) scale(1.15);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px) scale(1.15);
    }
}

.unread-badge.badge-pulse {
    animation: badgePulse 0.4s ease-out;
}

@keyframes badgePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* 通知アイコンの色変更用クラス */
.notification-icon-denied { color: #dc3545 !important; } /* 赤色 - 拒否 */
.notification-icon-default { color: #007bff !important; } /* 青色 - デフォルト */
.notification-icon-granted { color: #ffc107 !important; } /* 黄色 - ブラウザ許可済み */
.notification-icon-registered { color: #28a745 !important; } /* 緑色 - 完全に有効 */

/* スピナーアニメーション */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.notification-icon-spinner {
    display: inline-block !important;
    animation: spin 1s linear infinite !important;
    color: white !important;
}

.flash-animation {
    animation: flashIcon 0.5s ease-in-out 1;
}

@keyframes flashIcon {
    0% { transform: translateX(0) translateY(0) rotate(0deg) scale(1); }
    12.5% { transform: translateX(-4px) translateY(-2px) rotate(-5deg) scale(1.1); }
    25% { transform: translateX(4px) translateY(-4px) rotate(5deg) scale(1.2); }
    37.5% { transform: translateX(-3px) translateY(-1px) rotate(-3deg) scale(1.1); }
    50% { transform: translateX(3px) translateY(-3px) rotate(3deg) scale(1.15); }
    62.5% { transform: translateX(-2px) translateY(-1px) rotate(-2deg) scale(1.1); }
    75% { transform: translateX(2px) translateY(-2px) rotate(2deg) scale(1.05); }
    87.5% { transform: translateX(-1px) translateY(-1px) rotate(-1deg) scale(1.02); }
    100% { transform: translateX(0) translateY(0) rotate(0deg) scale(1); }
}

/* h1要素のサイズ調整 */
.header h1 {
    font-size: 1.0em;
    font-weight: 500;
}

/* グローバルh1スタイル */
h1 {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    color: var(--primary-color);
}

.section-title {
    font-size: 1.25rem;
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-weight: 600;
}

h3.section-title {
    font-size: 1.05rem;
    margin: 18px 0 8px 0;
}

/* コンテンツカード */
.content-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ポータル機能カードスタイル */
.portal-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.feature-card i.material-icons {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.feature-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

/* コンテナスタイル */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* アイコンボタン（共通） */
.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.btn-icon-success {
    background: #28a745;
    color: white;
}

.btn-icon-success:hover {
    background: #218838;
}

/* 汎用アクションボタン */
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    color: #6c757d;
}

.action-btn:hover {
    background: #f8f9fa;
}
