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

:root {
    --primary-color: #007AFF;
    --background-color: #F2F2F7;
    --card-background: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --border-color: #E5E5EA;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 80px; /* タブバーの高さ分 */
}

.app-container {
    max-width: 428px;
    margin: 0 auto;
    background-color: var(--background-color);
    min-height: 100vh;
}

/* ナビゲーションバー */
.navbar {
    background-color: var(--card-background);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-actions {
    display: flex;
    gap: 12px;
}

.icon-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    position: relative;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button svg {
    width: 24px;
    height: 24px;
}

.badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background-color: #FF3B30;
    border-radius: 50%;
}

/* メインコンテンツ */
.main-content {
    padding: 20px 16px;
}

/* ユーザー情報カード */
.user-card {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.user-avatar {
    flex-shrink: 0;
}

.avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(0, 122, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-email {
    font-size: 14px;
    color: var(--text-secondary);
}

/* セクションタイトル */
.section-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 0 4px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.view-all-link {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
}

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

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-button {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.quick-action-button:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-hover);
}

.action-icon {
    width: 28px;
    height: 28px;
}

.action-title {
    font-size: 12px;
    text-align: center;
}

.quick-action-button.blue .action-icon {
    color: #007AFF;
}

.quick-action-button.cyan .action-icon {
    color: #5AC8FA;
}

.quick-action-button.green .action-icon {
    color: #34C759;
}

.quick-action-button.orange .action-icon {
    color: #FF9500;
}

.quick-action-button.purple .action-icon {
    color: #AF52DE;
}

.quick-action-button.red .action-icon {
    color: #FF3B30;
}

/* 無効化されたクイックアクションボタン */
.quick-action-button.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.quick-action-button.disabled .action-icon {
    opacity: 0.3;
}

.quick-action-button.disabled .action-title {
    opacity: 0.3;
}

/* お知らせセクション */
.notices-section {
    margin-bottom: 20px;
}

.notices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notice-row {
    background-color: var(--card-background);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.notice-row:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-hover);
}

.notice-content {
    flex: 1;
}

.notice-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.notice-row:not(.unread) .notice-title {
    font-weight: 400;
}

.notice-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.notice-preview {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notices-list-page {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.back-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.back-button svg {
    width: 24px;
    height: 24px;
}

.unread-badge {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 12px;
}

.notice-row:not(.unread) .unread-badge {
    display: none;
}

/* 無効化されたお知らせ項目 */
.notice-row.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.notice-row.disabled .notice-title,
.notice-row.disabled .notice-date {
    opacity: 0.3;
}

.notice-row.disabled .unread-badge {
    opacity: 0.3;
}

/* タブバー */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 428px;
    background-color: var(--card-background);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s;
    flex: 1;
}

.tab-item svg {
    width: 28px;
    height: 28px;
}

.tab-item span {
    font-size: 10px;
}

.tab-item.active {
    color: var(--primary-color);
}

.tab-item:active {
    opacity: 0.7;
}

/* 無効化されたタブアイテム */
.tab-item.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* レスポンシブ対応 */
@media (max-width: 428px) {
    .app-container {
        max-width: 100%;
    }
    
    .tab-bar {
        max-width: 100%;
    }
}

/* ローディング状態 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* リストページ共通 */
.list-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
}

/* イベント項目 */
.event-item {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.event-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* TODO項目 */
.todo-item {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    position: relative;
}

.todo-item.completed {
    opacity: 0.7;
}

.todo-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
}

.todo-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0;
}

.todo-due-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.completed-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background-color: #34C759;
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
}

/* 役職項目 */
.role-item {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-primary);
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.role-item:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-hover);
}

.role-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.role-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 会員項目 */
.member-item {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.member-item:hover {
    background-color: rgba(0, 122, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.member-item:active {
    background-color: rgba(0, 122, 255, 0.1);
}

.member-avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--border-color);
}

.member-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(0, 122, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    flex-shrink: 0;
}

.member-info {
    flex: 1;
}

.member-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.member-company,
.member-department {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 2px 0;
}

/* 設定ページ */
.settings-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-section {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 15px;
}

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

.settings-value {
    color: var(--text-secondary);
    font-size: 14px;
}

.logout-button {
    width: 100%;
    padding: 16px;
    background-color: #FF3B30;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logout-button:active {
    opacity: 0.7;
}

/* 詳細ページ */
.detail-page {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.detail-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.detail-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.detail-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

.detail-content p {
    margin: 12px 0;
}

/* 実践項目 */
.practice-item {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.practice-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.practice-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.practice-title {
    font-size: 16px;
    color: var(--text-primary);
}

.practice-title.completed {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* プロフィール編集フォーム */
.profile-edit-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 16px !important;
    background-color: #ffffff !important;
}

.form-group {
    display: flex !important;
    flex-direction: column !important;
}

.form-label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    color: #333 !important;
}

.form-input-row {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.form-input {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}

.form-input-full {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

.required-mark {
    color: #dc3545;
    font-weight: bold;
    margin-left: 4px;
}

.form-notice {
    padding: 12px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    margin-bottom: 16px;
    border-radius: 4px;
}

.form-notice-text {
    margin: 0;
    font-size: 13px;
    color: #856404;
}

.info-box {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 8px;
}

.info-box-current {
    background: #f5f5f5;
    color: #666;
}

.info-box-warning {
    background: #fff0f0;
    border: 1px solid #f00;
    color: #c00;
}

.profile-hint-box {
    padding: 12px 16px;
    background: #e3f2fd;
    border-left: 4px solid #1976d2;
    margin: 0 16px 16px;
    border-radius: 4px;
}

.profile-hint-text {
    margin: 0;
    font-size: 13px;
    color: #1565c0;
}

.form-buttons {
    display: flex;
    gap: 8px;
    padding-top: 8px;
}

.btn-cancel {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    color: #666;
    cursor: pointer;
}

.btn-submit {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    display: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    margin-top: 8px;
}

.message-box {
    display: none;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    margin-top: 12px;
}

.message-box.success {
    display: block;
    background: #d4edda;
    color: #155724;
}

.message-box.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}

/* レスポンシブ対応 */
@media (max-width: 360px) {
    .form-input-row {
        flex-direction: column !important;
    }
    
    .form-input {
        width: 100% !important;
        flex: none !important;
    }
}

