/**
 * 共通スタイルシート
 * assets/css/common.css
 * 
 * モジュール読み込み時の共通スタイル
 * Phase 4: CSS変数適用
 */

/* ========================================
   モジュールローディング
   ======================================== */

.module-loading {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-lg);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xl);
}

.module-loading::before {
    content: "⏳";
    display: block;
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-lg);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* モジュールエラー */
.module-error {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-lg);
    background: var(--color-warning);
    border: var(--border-width-medium) solid var(--color-warning);
    border-radius: var(--border-radius-lg);
    margin: var(--spacing-lg);
}

.module-error p {
    color: var(--color-text-primary);
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-lg);
}

.module-error button {
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--color-warning);
    color: #333;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.module-error button:hover {
    background: #ffb300;
    transform: scale(1.05);
}

/* ========================================
   タブシステム
   ======================================== */

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* タブ切り替えアニメーション */
.tab-content.fade-out {
    animation: fadeOut 0.2s ease;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ========================================
   ローディングスピナー
   ======================================== */

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   メッセージボックス
   ======================================== */

.message-box {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-box.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message-box.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message-box.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.message-box.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* ========================================
   レスポンシブユーティリティ
   ======================================== */

.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
    
    .show-mobile {
        display: block;
    }
}

/* ========================================
   アクセシビリティ
   ======================================== */

/* スキップリンク */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* フォーカス表示 */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ========================================
   印刷スタイル
   ======================================== */

@media print {
    .tab-navigation,
    .module-loading,
    .module-error,
    button {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
    }
}
