/**
 * 項目進程管理系統 - 主樣式表
 * Project Progress Management System - Main Stylesheet
 */

/* ========== CSS Variables ========== */
:root {
  --primary-color: #667eea;
  --primary-dark: #5568d3;
  --secondary-color: #764ba2;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --text-color: #333;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --transition: all 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-color: #e0e0e0;
  --text-muted: #999;
  --border-color: #404040;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ========== Reset & Base ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft JhengHei", "微軟正黑體", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* ========== Login Page ========== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-box {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  animation: fadeInUp 0.5s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header .logo {
  font-size: 64px;
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 24px;
  color: var(--dark-color);
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 0;
}

.login-footer {
  margin-top: 24px;
  text-align: center;
}

.login-footer p {
  font-size: 12px;
  margin-bottom: 8px;
}

.login-footer .version {
  color: var(--text-muted);
}

/* ========== Forms ========== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--dark-color);
  font-weight: 500;
  font-size: 14px;
}

.form-group label .icon {
  margin-right: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
  transition: var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.5;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  color: white;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #218838;
  color: white;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #c82333;
  color: white;
}

.btn-warning {
  background: var(--warning-color);
  color: #212529;
}

.btn-warning:hover:not(:disabled) {
  background: #e0a800;
}

.btn-secondary {
  background: var(--text-muted);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #5a6268;
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* ========== Alerts ========== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid transparent;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.alert-error,
.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border-color: #ffeaa7;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
}

/* ========== Badges ========== */
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: white;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--radius-sm);
}

.badge-primary { background: var(--primary-color); }
.badge-success { background: var(--success-color); }
.badge-danger { background: var(--danger-color); }
.badge-warning { background: var(--warning-color); color: #212529; }
.badge-info { background: var(--info-color); }
.badge-secondary { background: var(--text-muted); }

/* ========== Progress Bar ========== */
.progress {
  height: 20px;
  background: #e9ecef;
  border-radius: var(--radius);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  transition: width 0.6s ease;
}

.progress-bar.bg-success { background: var(--success-color); }
.progress-bar.bg-warning { background: var(--warning-color); }
.progress-bar.bg-danger { background: var(--danger-color); }

/* ========== Animations ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .login-box {
    padding: 30px 20px;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .login-page {
    padding: 10px;
  }
  
  .login-box {
    padding: 24px 16px;
  }
}
