/* ========================================
   Navigator CSS - Navi v1.2 New UI
   Walker's Chat + Walker's Area Layout
======================================== */

/* ========================================
   CSS Variables
======================================== */
:root {
    /* Primary Colors */
    --color-primary: #3B82F6;
    --color-primary-hover: #2563EB;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-purple: #8B5CF6;
    --color-purple-hover: #7C3AED;

    /* Background Colors */
    --bg-page: #EEFAF2;
    --bg-white: #FFFFFF;
    --bg-gray: #F9FAFB;
    --bg-area: #D9D9D9;

    /* Workband Header Colors */
    --workband-design: #E0F2FE;
    --workband-config: #DCFCE7;
    --workband-impl-sandbox: #FEF9C3;
    --workband-impl-prod: #FEE2E2;
    --workband-verification: #E5E7EB;
    --workband-creative: #FAE8FF;

    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;

    /* Border Colors */
    --border-light: #E5E7EB;
    --border-main: #D1D5DB;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 24px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
}

/* ========================================
   Reset & Base Styles
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    min-height: 100vh;
    color: var(--text-primary);
}

/* ========================================
   Header
======================================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.nav-title {
    font-size: 14px;
    color: var(--text-muted);
    padding-left: 16px;
    border-left: 1px solid var(--border-light);
}

.role-badge {
    background: var(--workband-config);
    color: #166534;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-selector,
.user-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-gray);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.lang-selector:hover,
.user-menu:hover {
    background: #F3F4F6;
    border-color: var(--border-main);
}

/* ========================================
   Main Container
======================================== */
.main-container {
    display: flex;
    gap: 24px;
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

/* ========================================
   Walker's Chat (Left Side)
======================================== */
.walkers-chat {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

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

.suggestion-btn {
    background: var(--color-purple);
    color: var(--bg-white);
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-btn:hover {
    background: var(--color-purple-hover);
}

.chat-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.chat-input-section {
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    padding: 16px;
}

.chat-input-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-toggle {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 12px;
}

.chat-textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-textarea::placeholder {
    color: var(--text-light);
}

.chat-send-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--color-primary);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: var(--color-primary-hover);
}

/* Chat Log */
.chat-log {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.chat-log.expanded {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.chat-message {
    padding: 12px 0;
    border-bottom: 1px solid #F3F4F6;
}

.chat-message:last-child {
    border-bottom: none;
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.chat-message-icon {
    font-size: 18px;
}

.chat-message-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.chat-message-time {
    font-size: 11px;
    color: var(--text-light);
    margin-left: auto;
}

.chat-message-content {
    padding-left: 26px;
    color: #4B5563;
    font-size: 13px;
    line-height: 1.6;
}

/* ========================================
   Walker's Area (Main Area)
======================================== */
.walkers-area {
    flex: 1;
    min-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.area-section {
    background: var(--bg-area);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
}

.area-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.area-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.area-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Version Tabs */
.version-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.version-tab {
    padding: 8px 20px;
    background: var(--bg-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.version-tab:hover {
    background: #F3F4F6;
}

.version-tab.active {
    background: var(--color-primary);
    color: var(--bg-white);
}

/* ========================================
   Epic Card
======================================== */
.epic-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}

.epic-card:last-child {
    margin-bottom: 0;
}

.epic-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.epic-info {
    flex: 1;
}

.epic-id {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.epic-description {
    font-size: 12px;
    color: var(--text-muted);
}

.epic-progress {
    text-align: right;
}

.epic-progress-bar {
    width: 120px;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.epic-progress-fill {
    height: 100%;
    background: var(--color-success);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.epic-progress-text {
    font-size: 12px;
    color: var(--color-success);
    font-weight: 600;
}

/* ========================================
   6-Workband Grid
======================================== */
.workband-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.workband-column {
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    min-height: 150px;
    display: flex;
    flex-direction: column;
}

.workband-header {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* Workband Header Colors */
.workband-header-1 { background: var(--workband-design); }
.workband-header-2 { background: var(--workband-config); }
.workband-header-3 { background: var(--workband-impl-sandbox); }
.workband-header-4 { background: var(--workband-impl-prod); }
.workband-header-5 { background: var(--workband-verification); }
.workband-header-6 { background: var(--workband-creative); }

.workband-body {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========================================
   Task Card
======================================== */
.task-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

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

.task-header {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.task-workband-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--bg-white);
}

/* Workband Badge Colors */
.badge-design { background: var(--color-primary); }
.badge-config { background: var(--color-success); }
.badge-impl-sandbox { background: var(--color-warning); }
.badge-impl-prod { background: var(--color-danger); }
.badge-verification { background: var(--text-muted); }
.badge-creative { background: var(--color-purple); }

.task-id {
    font-size: 10px;
    color: var(--color-primary);
    font-weight: 600;
}

.task-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.task-description {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #F3F4F6;
}

.task-status {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
}

.status-done {
    background: var(--color-success);
    color: var(--bg-white);
}

.status-in-progress {
    background: var(--color-primary);
    color: var(--bg-white);
}

.status-todo {
    background: var(--border-light);
    color: var(--text-muted);
}

/* Task Card Simple (for completed tasks) */
.task-card-simple {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 10px;
    box-shadow: var(--shadow-sm);
}

.task-card-simple .task-header {
    margin-bottom: 4px;
}

.task-card-simple .task-title {
    font-size: 11px;
    margin-bottom: 2px;
}

.task-card-simple .task-description {
    font-size: 10px;
    margin-bottom: 0;
}

/* No Tasks Display */
.no-tasks {
    color: var(--text-light);
    font-size: 11px;
    text-align: center;
    padding: 20px 8px;
}

/* ========================================
   Collapsed Epic
======================================== */
.epic-collapsed {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.epic-collapsed-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.epic-collapsed-note {
    font-size: 12px;
    color: var(--text-light);
}

/* ========================================
   Scroll Container (PC Fixed Width)
======================================== */
.scroll-container {
    overflow-x: auto;
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 1400px) {
    .main-container {
        flex-direction: column;
    }

    .walkers-chat {
        width: 100%;
    }

    .walkers-area {
        min-width: auto;
    }

    .scroll-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .workband-grid {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .main-container {
        padding: 16px;
    }

    .chat-card {
        padding: 16px;
    }

    .area-section {
        padding: 16px;
    }

    .epic-card {
        padding: 16px;
    }

    .epic-header {
        flex-direction: column;
        gap: 12px;
    }

    .epic-progress {
        text-align: left;
    }

    .epic-progress-bar {
        width: 100%;
    }
}
