﻿/**
 * ファイル名: /assets/css/common.css
 * 設置場所: /jiritsukai/assets/css/
 * 役割: システム全体の共通スタイル
 */

/* ========================================
   基本設定
======================================== */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --warning-color: #f6ad55;
    --danger-color: #f56565;
    --info-color: #4299e1;
    --text-dark: #2d3748;
    --text-medium: #4a5568;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
}

/* ========================================
   ベーススタイル
======================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    min-height: 100vh;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========================================
   ヘッダー
======================================== */
.header {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.header-title a:hover {
    color: var(--primary-dark);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-item {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--text-medium);
    font-weight: 500;
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #e53e3e;
}

/* ========================================
   フッター
======================================== */
.footer {
    background: white;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

/* ========================================
   ボタン
======================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

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

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

.btn-success:hover {
    background: #38a169;
}

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

.btn-warning:hover {
    background: #ed8936;
}

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

.btn-danger:hover {
    background: #e53e3e;
}

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

.btn-info:hover {
    background: #3182ce;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ========================================
   バッジ
======================================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

.badge-secondary {
    background: var(--text-light);
    color: white;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

.badge-light {
    background: var(--bg-light);
    color: var(--text-medium);
}

/* ========================================
   カード
======================================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

/* ========================================
   テーブル
======================================== */
.table {
    width: 100%;
    background: white;
    border-collapse: collapse;
}

.table th {
    background: var(--bg-light);
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table tr:hover {
    background: var(--bg-light);
}

.table-striped tbody tr:nth-child(odd) {
    background: rgba(247, 250, 252, 0.5);
}

/* ========================================
   フォーム
======================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-label.required::after {
    content: " *";
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.form-error {
    color: var(--danger-color);
}

/* ========================================
   アラート
======================================== */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.alert-primary {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
    color: #2c5282;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    border-color: rgba(72, 187, 120, 0.2);
    color: #22543d;
}

.alert-warning {
    background: rgba(246, 173, 85, 0.1);
    border-color: rgba(246, 173, 85, 0.2);
    color: #7c2d12;
}

.alert-danger {
    background: rgba(245, 101, 101, 0.1);
    border-color: rgba(245, 101, 101, 0.2);
    color: #742a2a;
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    border-color: rgba(66, 153, 225, 0.2);
    color: #2a4e7c;
}

/* ========================================
   モーダル
======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ========================================
   ユーティリティクラス
======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-light); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }
.text-info { color: var(--info-color); }

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-block { display: inline-block; }

.flex-column { flex-direction: column; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

/* ========================================
   レスポンシブ
======================================== */
@media (max-width: 768px) {
    .main {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .modal {
        width: 95%;
    }
}