---
globs: *.css,*.scss,*.vue
---

# Styling và CSS Guidelines

## CSS Architecture
Dự án sử dụng Bootstrap 5.2.3 làm base framework với custom CSS:

- [style.css](mdc:src/style.css) - Global styles
- [assets/css/](mdc:src/assets/css/) - Component-specific styles
- [assets/site.css](mdc:src/assets/site.css) - Site-wide styles

## CSS Organization
```css
/* Global styles - style.css */
:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
}

/* Component styles - scoped trong Vue components */
<style scoped>
.component-container {
  padding: 1rem;
  border-radius: 0.375rem;
}

.component-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
</style>
```

## Bootstrap Integration
```vue
<template>
  <!-- Sử dụng Bootstrap classes -->
  <div class="container-fluid">
    <div class="row">
      <div class="col-md-8">
        <div class="card">
          <div class="card-header">
            <h5 class="card-title mb-0">Tiêu đề</h5>
          </div>
          <div class="card-body">
            <form class="needs-validation" novalidate>
              <div class="mb-3">
                <label for="email" class="form-label">Email</label>
                <input 
                  type="email" 
                  class="form-control" 
                  id="email" 
                  required
                >
                <div class="invalid-feedback">
                  Vui lòng nhập email hợp lệ
                </div>
              </div>
              
              <div class="d-grid gap-2 d-md-flex justify-content-md-end">
                <button type="button" class="btn btn-secondary me-md-2">
                  Hủy
                </button>
                <button type="submit" class="btn btn-primary">
                  Lưu
                </button>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
```

## Custom CSS Classes
```css
/* Utility classes */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.active {
  background-color: var(--success-color);
  color: white;
}

.status-badge.inactive {
  background-color: var(--secondary-color);
  color: white;
}
```

## Responsive Design
```vue
<template>
  <div class="responsive-container">
    <!-- Mobile first approach -->
    <div class="row g-3">
      <div class="col-12 col-md-6 col-lg-4">
        <!-- Content -->
      </div>
    </div>
  </div>
</template>

<style scoped>
.responsive-container {
  padding: 1rem;
}

/* Mobile styles */
@media (max-width: 767.98px) {
  .responsive-container {
    padding: 0.5rem;
  }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 991.98px) {
  .responsive-container {
    padding: 1.5rem;
  }
}

/* Desktop styles */
@media (min-width: 992px) {
  .responsive-container {
    padding: 2rem;
  }
}
</style>
```

## CSS Variables
```css
/* Define custom properties */
:root {
  --lada-primary: #1e3a8a;
  --lada-secondary: #64748b;
  --lada-success: #059669;
  --lada-danger: #dc2626;
  --lada-warning: #d97706;
  --lada-info: #0891b2;
  
  --lada-border-radius: 0.375rem;
  --lada-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --lada-transition: all 0.15s ease-in-out;
}

/* Use variables */
.btn-lada {
  background-color: var(--lada-primary);
  border-radius: var(--lada-border-radius);
  box-shadow: var(--lada-box-shadow);
  transition: var(--lada-transition);
}
```

## Animation và Transitions
```css
/* Fade transitions */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* Slide transitions */
.slide-enter-active,
.slide-leave-active {
  transition: transform 0.3s ease;
}

.slide-enter-from {
  transform: translateX(-100%);
}

.slide-leave-to {
  transform: translateX(100%);
}

/* Loading animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  animation: spin 1s linear infinite;
}
```

## Dark Mode Support
```css
/* Light mode (default) */
:root {
  --bg-color: #ffffff;
  --text-color: #212529;
  --border-color: #dee2e6;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #212529;
    --text-color: #ffffff;
    --border-color: #495057;
  }
}

/* Manual dark mode toggle */
[data-theme="dark"] {
  --bg-color: #212529;
  --text-color: #ffffff;
  --border-color: #495057;
}

.themed-element {
  background-color: var(--bg-color);
  color: var(--text-color);
  border-color: var(--border-color);
}
```

## Performance Optimization
```css
/* Use transform instead of changing layout properties */
.optimized-animation {
  transform: translateX(0);
  transition: transform 0.3s ease;
}

.optimized-animation.moved {
  transform: translateX(100px);
}

/* Use will-change for elements that will animate */
.animated-element {
  will-change: transform, opacity;
}

/* Remove will-change after animation */
.animated-element.animation-complete {
  will-change: auto;
}
```