/**
 * HRI Employee System - Frontend Styles (Complete Version)
 * フロントエンド（社員用）完全版スタイルシート
 * 
 * @package HRI_Employee_System
 * @since 1.0.0
 */

/* ===== CSS変数 ===== */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --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;
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.2s ease-in-out;
}

/* ===== ベーススタイル ===== */
body.hri-frontend-body {
    font-family: var(--font-family);
    background: var(--gray-50);
    color: var(--gray-900);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.hri-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ===== ダッシュボードヘッダー ===== */
.dashboard-header {
    background: linear-gradient(135deg, #263238 0%, #263238 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.welcome-text {
    font-size: 1.125rem;
    opacity: 0.95;
    margin: 0;
}

/* ===== 出退勤セクション ===== */
.attendance-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    text-align: center;
}

.attendance-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.btn-clock-in, .btn-clock-out {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 280px;
}

.btn-clock-in {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-clock-in:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-clock-out {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-clock-out:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.btn-clock-in:disabled,
.btn-clock-out:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-clock-in.loading,
.btn-clock-out.loading {
    position: relative;
    color: transparent;
}

.btn-clock-in.loading::after,
.btn-clock-out.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.clock-in-time {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--gray-100);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.attendance-complete {
    padding: 1.5rem;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: 0.75rem;
    color: #065f46;
}

.complete-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.attendance-times {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== ポイントセクション ===== */
.points-section {
    margin-bottom: 1.5rem;
}

.points-card {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 1rem;
    padding: 2rem;
    color: white;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.points-card.negative {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

.points-header h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    opacity: 0.95;
}

.points-value {
    text-align: center;
    margin-bottom: 1.5rem;
}

.points-number {
    display: block;
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.points-label {
    display: block;
    margin-top: 0.5rem;
    font-size: 1rem;
    opacity: 0.9;
}

.points-warning {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-icon {
    font-size: 1.5rem;
}

.points-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.points-details a {
    color: white;
    text-decoration: underline;
    font-size: 0.875rem;
}

/* ===== タスクセクション ===== */
.tasks-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.tasks-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    color: var(--gray-900);
}

.no-tasks {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-item {
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all var(--transition);
    background: white;
}

.task-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.task-item.task-status-pending {
    border-left: 4px solid var(--warning-color);
}

.task-item.task-status-in_progress {
    border-left: 4px solid var(--info-color);
}

.task-item.task-status-completed {
    border-left: 4px solid var(--success-color);
    opacity: 0.7;
}

.task-item.task-status-overdue {
    border-left: 4px solid var(--danger-color);
    background: #fef2f2;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.task-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.task-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.task-status-badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.task-status-badge.status-in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.task-status-badge.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.task-status-badge.status-overdue {
    background: #fee2e2;
    color: #991b1b;
}

.task-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-report {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-report:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ===== 警告セクション ===== */
.warnings-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.warnings-widget h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    color: var(--danger-color);
}

.warnings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.warning-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fef2f2;
    border-left: 4px solid var(--danger-color);
    border-radius: 0.5rem;
}

.warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-content {
    flex: 1;
}

.warning-message {
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.warning-date {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* ===== 最近の活動 ===== */
.recent-activity-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.recent-activity-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
}

.activity-list {
    position: relative;
    padding-left: 2.5rem;
}

.activity-list::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.activity-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.activity-icon {
    position: absolute;
    left: -2.5rem;
    width: 2rem;
    height: 2rem;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.activity-content {
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
}

.activity-description {
    font-size: 0.875rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.no-activity {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

/* ===== 通知システム ===== */
.hri-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    max-width: 400px;
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 9999;
    transform: translateX(500px);
    transition: transform 0.3s ease-out;
}

.hri-notification.show {
    transform: translateX(0);
}

.hri-notification-success {
    border-left: 4px solid var(--success-color);
}

.hri-notification-error {
    border-left: 4px solid var(--danger-color);
}

.hri-notification-info {
    border-left: 4px solid var(--info-color);
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-900);
}

/* ===== レスポンシブデザイン ===== */
@media (max-width: 768px) {
    .hri-dashboard {
        padding: 1rem 0.75rem;
    }
    
    .dashboard-header {
        padding: 1.5rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .attendance-section,
    .tasks-section,
    .warnings-section,
    .recent-activity-section {
        padding: 1.5rem;
    }
    
    .btn-clock-in,
    .btn-clock-out {
        min-width: 100%;
        padding: 1rem 2rem;
        font-size: 1.125rem;
    }
    
    .points-number {
        font-size: 3rem;
    }
    
    .task-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .task-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .hri-notification {
        right: 1rem;
        left: 1rem;
        max-width: calc(100% - 2rem);
    }
}

@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 1.25rem;
    }
    
    .welcome-text {
        font-size: 1rem;
    }
    
    .points-card {
        padding: 1.5rem;
    }
    
    .points-number {
        font-size: 2.5rem;
    }
    
    .task-title {
        font-size: 1rem;
    }
    
    .activity-list {
        padding-left: 2rem;
    }
}

/* ===== ユーティリティクラス ===== */
.text-center {
    text-align: center;
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-muted {
    color: var(--gray-500);
}

/* ===== 印刷用スタイル ===== */
@media print {
    .attendance-buttons,
    .task-actions,
    .btn-report {
        display: none;
    }
    
    .hri-dashboard {
        padding: 0;
    }
    
    .dashboard-header {
        background: none;
        color: black;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .task-item {
        page-break-inside: avoid;
    }
}