/* =======================
   SAIYU Tool Navi - メインCSS
   西友電気備品管理システム
   ======================= */

/* リセット & ベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    overflow-x: hidden;
}

/* CSS カスタムプロパティ（色とサイズ） */
:root {
    /* ブランドカラー - ブルー系統 */
    --primary-color: #1976d2;
    --primary-light: #42a5f5;
    --primary-dark: #0d47a1;
    
    /* セカンダリカラー */
    --secondary-color: #1565c0;
    --accent-color: #2196f3;
    
    /* グレースケール */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    
    /* フィードバックカラー */
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --info-color: #2196f3;
    
    /* サイズ */
    --header-height: 60px;
    --bottom-nav-height: 80px;
    --container-padding: 16px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* シャドウ */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    
    /* アニメーション */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* =======================
   ローディング画面
   ======================= */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

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

.loading-text {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.loading-subtitle {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.9;
}

/* =======================
   メインアプリ構造
   ======================= */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.main {
    flex: 1;
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
    overflow-y: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

/* =======================
   ヘッダー
   ======================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--container-padding);
    max-width: 1200px;
    margin: 0 auto;
}

.header-brand {
    display: flex;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.9;
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 18px;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.btn-icon:active {
    transform: scale(0.95);
}

/* =======================
   ビューシステム
   ======================= */
.view {
    display: none;
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}

.view-active {
    display: block;
}

/* =======================
   ユーザー情報
   ======================= */
.user-info {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-icon {
    font-size: 28px;
    color: white;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.user-role {
    font-size: 14px;
    color: var(--gray-600);
}

.login-status {
    flex-shrink: 0;
}

/* =======================
   セクションタイトル
   ======================= */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-icon {
    font-size: 22px;
}

/* =======================
   クイックアクション
   ======================= */
.quick-actions {
    margin-bottom: 32px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

/* action-card定義はicons.cssに移動済み */

/* action-icon定義はicons.cssに移動済み */

.action-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.action-desc {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.4;
}

/* =======================
   ステータス概要
   ======================= */
.status-overview {
    margin-bottom: 32px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
}

.status-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.status-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.status-label {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

/* =======================
   アクティビティ
   ======================= */
.recent-activity {
    margin-bottom: 32px;
}

.activity-list {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.activity-item {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-fast);
}

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

.activity-item:hover {
    background: var(--gray-50);
}

.activity-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.activity-time {
    font-size: 12px;
    color: var(--gray-500);
}

/* =======================
   ボタン
   ======================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    min-height: 44px;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* =======================
   ボトムナビゲーション
   ======================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: white;
    border-top: 1px solid var(--gray-200);
    display: flex;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--gray-500);
    padding: 8px 4px;
    gap: 4px;
}

.nav-item:hover {
    background: var(--gray-50);
}

.nav-item-active {
    color: var(--primary-color);
    background: var(--gray-50);
}

.nav-icon {
    font-size: 20px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* =======================
   レスポンシブデザイン
   ======================= */

/* タブレット */
@media (max-width: 768px) {
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .brand-name {
        font-size: 16px;
    }
    
    .brand-subtitle {
        font-size: 12px;
    }
}

/* スマートフォン */
@media (max-width: 480px) {
    :root {
        --container-padding: 12px;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .user-info {
        padding: 16px;
    }
    
    .action-card {
        padding: 20px;
        min-height: 120px;
    }
    
    /* action-icon定義はicons.cssに移動済み */
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-label {
        font-size: 10px;
    }
}

/* 超小画面 */
@media (max-width: 360px) {
    .header-container {
        padding: 0 12px;
    }
    
    .brand-name {
        font-size: 14px;
    }
    
    .brand-subtitle {
        font-size: 11px;
    }
}

/* =======================
   ダークモード対応（オプション）
   ======================= */
@media (prefers-color-scheme: dark) {
    /* 将来的にダークモード対応時に使用 */
}