/* ==================== 
   カラー変数
   ==================== */
:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --white: #ffffff;
    --black: #000000;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    --sidebar-width: 260px;
    --topbar-height: 70px;
    
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-ai: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* ==================== 
   サイドバー
   ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.5rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 8px;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    background-color: var(--gray-100);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: var(--white);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.125rem;
}

.ai-nav-item {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
    border: 1px solid rgba(240, 147, 251, 0.3);
}

.ai-nav-item:hover {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.2) 0%, rgba(245, 87, 108, 0.2) 100%);
    border-color: rgba(240, 147, 251, 0.5);
}

.ai-badge {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background: var(--gradient-ai);
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 12px;
    letter-spacing: 0.05em;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--gray-50);
    border-radius: 8px;
}

.user-avatar {
    font-size: 2rem;
    color: var(--primary-color);
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-900);
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ==================== 
   メインコンテンツ
   ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== 
   トップバー
   ==================== */
.topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--gray-100);
    padding: 0.625rem 1rem;
    border-radius: 8px;
    min-width: 300px;
}

.search-box i {
    color: var(--gray-400);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-900);
}

.search-box input::placeholder {
    color: var(--gray-400);
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color);
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
}

/* ==================== 
   ダッシュボードコンテンツ
   ==================== */
.dashboard-content {
    padding: 2rem;
    flex: 1;
}

/* ==================== 
   AIマッチング推奨カード
   ==================== */
.ai-recommendation-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 2px solid transparent;
    background-image: linear-gradient(var(--white), var(--white)), 
                      linear-gradient(135deg, rgba(240, 147, 251, 0.3) 0%, rgba(245, 87, 108, 0.3) 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.ai-card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ai-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: var(--gradient-ai);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--white);
    box-shadow: 0 8px 16px rgba(240, 147, 251, 0.3);
}

.ai-card-title-section {
    flex: 1;
}

.ai-card-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-badge-inline {
    padding: 0.25rem 0.75rem;
    background: var(--gradient-ai);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

.ai-card-subtitle {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.ai-view-all-btn {
    padding: 0.75rem 1.5rem;
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-view-all-btn:hover {
    background: var(--gray-200);
}

.ai-matches-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.ai-match-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.ai-match-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.match-score-ring {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
}

.progress-ring {
    transform: rotate(-90deg);
}

.match-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.125rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.match-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    padding: 0.375rem 0.75rem;
    background: var(--gradient-success);
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

.freelancer-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    overflow: hidden;
    border: 3px solid var(--gray-200);
}

.freelancer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.freelancer-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.freelancer-title {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.freelancer-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.skill-tag {
    padding: 0.25rem 0.75rem;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
}

.freelancer-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

.freelancer-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.freelancer-stats .stat i {
    color: var(--warning-color);
}

.match-reasons {
    margin-bottom: 1rem;
    text-align: left;
}

.reason-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.reason-item i {
    color: var(--success-color);
}

.contact-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.ai-insight-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
}

.ai-insight-box i {
    font-size: 1.5rem;
    color: var(--warning-color);
    flex-shrink: 0;
}

.ai-insight-text {
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.6;
}

.ai-insight-text strong {
    color: var(--primary-color);
}

/* ==================== 
   統計カード
   ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* ==================== 
   コンテンツグリッド
   ==================== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.content-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    color: var(--primary-color);
}

.view-all-link {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* ==================== 
   プロジェクトリスト
   ==================== */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.project-item:hover {
    background: var(--gray-100);
}

.project-info {
    flex: 1;
}

.project-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.project-client {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.project-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-progress {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.status-review {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.project-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    width: 100px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    min-width: 35px;
}

/* ==================== 
   タスクリスト
   ==================== */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.task-item:hover {
    background: var(--gray-100);
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.task-content {
    flex: 1;
    cursor: pointer;
}

.task-content.completed {
    opacity: 0.5;
}

.task-content.completed .task-name {
    text-decoration: line-through;
}

.task-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.task-time {
    font-size: 0.75rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.task-priority {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.task-priority.high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.task-priority.medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.task-priority.low {
    background: rgba(107, 114, 128, 0.1);
    color: var(--gray-600);
}

/* ==================== 
   レスポンシブ
   ==================== */
@media (max-width: 1200px) {
    .ai-matches-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 968px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .search-box {
        display: none;
    }
    
    .ai-matches-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .dashboard-content {
        padding: 1rem;
    }
    
    .ai-recommendation-card {
        padding: 1rem;
    }
    
    .ai-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .topbar {
        padding: 0 1rem;
    }
}
