/* DPSJ Platform Custom Styles */

/* Theme Variables */
:root {
  /* Default Theme (Blue Tech) */
  --theme-primary: #2563eb;
  --theme-primary-light: #3b82f6;
  --theme-primary-dark: #1d4ed8;
  --theme-secondary: #64748b;
  --theme-bg-primary: #ffffff;
  --theme-bg-secondary: #f8fafc;
  --theme-bg-sidebar: #1e40af;
  --theme-text-primary: #ffffff;
  --theme-text-secondary: #bfdbfe;
  --theme-text-muted: #93c5fd;
  --theme-border: #3b82f6;
  --theme-hover: rgba(59, 130, 246, 0.1);
  --theme-active: rgba(147, 197, 253, 0.2);
  --theme-active-text: #ffffff;
}

/* Gray Corporate Theme */
[data-theme="gray"] {
  --theme-primary: #4b5563;
  --theme-primary-light: #6b7280;
  --theme-primary-dark: #374151;
  --theme-secondary: #9ca3af;
  --theme-bg-primary: #ffffff;
  --theme-bg-secondary: #f9fafb;
  --theme-bg-sidebar: #EDEEEE;
  --theme-text-primary: #374151;
  --theme-text-secondary: #6b7280;
  --theme-text-muted: #9ca3af;
  --theme-border: #d1d5db;
  --theme-hover: rgba(107, 114, 128, 0.05);
  --theme-active: #E7E7E7;
  --theme-active-text: #374151;
}

/* Theme Switcher Styles */
.theme-switcher {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.theme-button {
  width: 20px;
  height: 20px;
  border: 2px solid var(--theme-border);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.theme-button:hover {
  border-color: var(--theme-text-secondary);
}

.theme-button.active {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 1px var(--theme-primary);
}

.theme-button.blue {
  background-color: #2563eb;
}

.theme-button.gray {
  background-color: #4b5563;
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Custom focus styles */
.focus-purple:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
}

/* DPSJ Brand Colors */
.bg-dpsj-purple {
    background-color: #6366f1;
}

.bg-dpsj-blue {
    background-color: #3b82f6;
}

.text-dpsj-purple {
    color: #6366f1;
}

.text-dpsj-blue {
    color: #3b82f6;
}

.border-dpsj-purple {
    border-color: #6366f1;
}

/* Django Checkbox Styling - Keep labels inline */
.django-checkbox-grid label {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.5rem !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.375rem !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
}

.django-checkbox-grid label:hover {
    background-color: #f9fafb !important;
}

.django-checkbox-grid input[type="checkbox"] {
    margin: 0 !important;
    flex-shrink: 0 !important;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.animate-pulse-custom {
    animation: pulse 2s infinite;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #6366f1;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Custom form styles */
.form-input {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent;
}

.form-select {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent bg-white;
}

.form-textarea {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent resize-none;
}

/* Button styles */
.btn-primary {
    @apply bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 transition duration-200;
}

.btn-secondary {
    @apply bg-gray-600 text-white px-4 py-2 rounded-lg hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition duration-200;
}

.btn-outline {
    @apply border border-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition duration-200;
}

/* Alert styles */
.alert {
    @apply p-4 rounded-md border;
}

.alert-success {
    @apply bg-green-50 text-green-700 border-green-200;
}

.alert-error {
    @apply bg-red-50 text-red-700 border-red-200;
}

.alert-warning {
    @apply bg-yellow-50 text-yellow-700 border-yellow-200;
}

.alert-info {
    @apply bg-blue-50 text-blue-700 border-blue-200;
}

/* Table styles */
.table-responsive {
    @apply overflow-x-auto;
}

.table {
    @apply min-w-full divide-y divide-gray-200;
}

.table thead {
    @apply bg-gray-50;
}

.table th {
    @apply px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider;
}

.table td {
    @apply px-6 py-4 whitespace-nowrap text-sm text-gray-900;
}

.table tbody tr:hover {
    @apply bg-gray-50;
}

/* Status badges */
.status-badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.status-active {
    @apply bg-green-100 text-green-800;
}

.status-inactive {
    @apply bg-red-100 text-red-800;
}

.status-pending {
    @apply bg-yellow-100 text-yellow-800;
}

.status-warning {
    @apply bg-orange-100 text-orange-800;
}

/* Card styles */
.card {
    @apply bg-white rounded-lg shadow-sm border;
}

.card-header {
    @apply p-6 border-b;
}

.card-body {
    @apply p-6;
}

.card-footer {
    @apply p-6 border-t bg-gray-50;
}

/* KPI Card specific styles */
.kpi-card {
    @apply bg-white p-6 rounded-lg shadow-sm border hover:shadow-md transition-shadow duration-200;
}

.kpi-value {
    @apply text-2xl font-bold text-gray-900;
}

.kpi-label {
    @apply text-sm font-medium text-gray-600;
}

.kpi-trend {
    @apply text-xs font-medium;
}

.kpi-trend.positive {
    @apply text-green-600;
}

.kpi-trend.negative {
    @apply text-red-600;
}

.kpi-trend.neutral {
    @apply text-gray-600;
}

/* Navigation styles */
.nav-link {
    @apply flex items-center space-x-3 p-3 rounded-lg text-gray-700 hover:bg-gray-100 transition duration-200;
}

.nav-link.active {
    @apply bg-purple-50 text-purple-700;
}

.nav-section-title {
    @apply px-3 text-xs font-semibold text-gray-500 uppercase tracking-wide;
}

/* Profile styles */
.profile-avatar {
    @apply bg-gradient-to-r from-purple-400 to-blue-500 rounded-full flex items-center justify-center;
}

.profile-avatar-sm {
    @apply w-8 h-8;
}

.profile-avatar-md {
    @apply w-10 h-10;
}

.profile-avatar-lg {
    @apply w-16 h-16;
}

/* Modal styles */
.modal-overlay {
    @apply fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity;
}

.modal-container {
    @apply inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full;
}

.modal-header {
    @apply bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4;
}

.modal-footer {
    @apply bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse;
}

/* Utility classes */
.text-truncate {
    @apply truncate;
}

.border-dashed {
    border-style: dashed;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break-after {
        page-break-after: always;
    }
    
    .print-break-before {
        page-break-before: always;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full-width {
        width: 100%;
    }
    
    .mobile-text-sm {
        font-size: 0.875rem;
    }
}

/* Dark mode support (future feature) */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        --bg-primary: #1f2937;
        --bg-secondary: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --border-color: #4b5563;
    }
}

/* Custom transitions */
.transition-all-fast {
    transition: all 0.15s ease-in-out;
}

.transition-all-slow {
    transition: all 0.3s ease-in-out;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for better accessibility */
.focus-visible:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .high-contrast {
        border: 2px solid currentColor;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
