/* Custom styles for ProjectMaster */

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: 0 0% 3.9%;
        --foreground: 0 0% 98%;
        --card: 0 0% 3.9%;
        --card-foreground: 0 0% 98%;
        --primary: 0 0% 98%;
        --primary-foreground: 0 0% 9%;
        --secondary: 0 0% 14.9%;
        --secondary-foreground: 0 0% 98%;
        --muted: 0 0% 14.9%;
        --muted-foreground: 0 0% 63.9%;
        --accent: 0 0% 14.9%;
        --accent-foreground: 0 0% 98%;
        --destructive: 0 62.8% 30.6%;
        --destructive-foreground: 0 0% 98%;
        --border: 0 0% 14.9%;
        --input: 0 0% 14.9%;
        --ring: 0 0% 83.1%;
    }
}

/* Light mode variables */
:root {
    --background: 0 0% 100%;
    --foreground: 0 0% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 3.9%;
    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;
    --secondary: 0 0% 96.1%;
    --secondary-foreground: 0 0% 9%;
    --muted: 0 0% 96.1%;
    --muted-foreground: 0 0% 45.1%;
    --accent: 0 0% 96.1%;
    --accent-foreground: 0 0% 9%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 89.8%;
    --input: 0 0% 89.8%;
    --ring: 0 0% 3.9%;
    --radius: 0.5rem;
}

/* Base styles */
* {
    border-color: hsl(var(--border));
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', sans-serif;
}

/* Utility classes */
[x-cloak] { 
    display: none !important; 
}

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

::-webkit-scrollbar-track {
    background: hsl(var(--muted));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--muted-foreground));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--foreground));
}

/* Task card animations */
.task-card {
    transition: all 0.2s ease-in-out;
}

.task-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Drag and drop styles */
.task-card[draggable="true"] {
    cursor: grab;
}

.task-card[draggable="true"]:active {
    cursor: grabbing;
}

.task-card.opacity-50 {
    opacity: 0.5;
}

/* Drop zone highlighting */
[data-status].bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.1);
}

.dark [data-status].bg-blue-900\/20 {
    background-color: rgba(30, 58, 138, 0.2);
}

/* Modal background blur and open animation */
#taskModal {
  backdrop-filter: blur(6px);
  background: rgba(0,0,0,0.45);
  transition: opacity 0.3s;
}
#taskModal .modal-animate {
  animation: modalOpen 0.35s cubic-bezier(.4,2,.6,1) both;
}
@keyframes modalOpen {
  0% { opacity: 0; transform: scale(0.92) translateY(30px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
/* End modal blur/animation */

/* Modal animations */
#taskModal {
    transition: opacity 0.2s ease-in-out;
}

#taskModal.show {
    display: flex !important;
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.3s ease-in-out;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    padding: 0.25rem 0.5rem;
}

/* Button hover effects */
.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Card hover effects */
.card {
    transition: all 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Sidebar active state */
.sidebar-item.active {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

/* Responsive design improvements */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left 0.3s ease-in-out;
        z-index: 40;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid hsl(var(--border));
    border-top: 2px solid hsl(var(--primary));
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast notifications */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.toast.show {
    transform: translateX(0);
}

/* Form styles */
.form-input {
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 30;
    min-width: 8rem;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    text-align: left;
    background: none;
    border: none;
    font-size: 0.875rem;
    color: hsl(var(--foreground));
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.dropdown-item:hover {
    background-color: hsl(var(--accent));
}

/* Utility classes */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-balance {
    text-wrap: balance;
}

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .sidebar,
    .header,
    button,
    .task-menu {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    .bg-gray-800, .rounded-lg, .shadow-lg, .p-6, .p-4 {
        box-shadow: none !important;
        background: #fff !important;
        color: #000 !important;
    }
    canvas, table, .chart-section {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
} 

/* Subtasks modern UI */
.subtask-item {
  display: flex;
  align-items: center;
  background: hsl(var(--secondary));
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  transition: box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  position: relative;
}
.subtask-item.done .subtask-title {
  text-decoration: line-through;
  color: #22c55e;
}
.subtask-item.overdue .subtask-title {
  color: #dc2626;
  font-weight: 600;
}
.subtask-title {
  flex: 1;
  font-size: 1rem;
  margin-left: 0.75rem;
  transition: color 0.2s;
}
.subtask-actions {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.subtask-item:hover .subtask-actions {
  opacity: 1;
}
.subtask-checkbox {
  width: 1.1em;
  height: 1.1em;
  accent-color: #22c55e;
}
.subtask-badge-overdue {
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
}
/* End subtasks UI */ 

.modal-blur > #main-content, .modal-blur > .p-6, .modal-blur > .dashboard-content, .modal-blur > .main-content {
  filter: blur(6px) grayscale(0.1) brightness(0.8);
  pointer-events: none;
  user-select: none;
  transition: filter 0.3s;
} 

.kpi-header {
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
.kpi-card {
  background: rgba(255,255,255,0.01);
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.kpi-label {
  font-size: 0.85rem;
  color: #b0b0b0;
  margin-bottom: 0.25rem;
  font-weight: 500;
  line-height: 1.2;
}
.kpi-value {
  font-size: 1.15rem;
  color: #fff;
  font-weight: 600;
  word-break: break-word;
  line-height: 1.3;
  overflow-wrap: break-word;
  white-space: normal;
}
.kpi-main {
  display: block;
  font-size: 1.08em;
  font-weight: 600;
  color: #fff;
}
.kpi-sub {
  display: block;
  font-size: 0.95em;
  color: #b0b0b0;
  font-weight: 400;
  margin-top: 0.1em;
}
@media (max-width: 900px) {
  .kpi-header {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .kpi-header {
    grid-template-columns: 1fr 1fr;
  }
} 

.modal-animate {
  opacity: 0;
  transform: scale(0.92) translateY(30px);
  transition: opacity 0.35s cubic-bezier(.4,2,.6,1), transform 0.35s cubic-bezier(.4,2,.6,1);
}
.modal-animate.open {
  opacity: 1;
  transform: scale(1) translateY(0);
} 

/* Shared modal overlay (blur + dim) */
.app-modal {
  backdrop-filter: blur(6px);
  background: rgba(0,0,0,0.45);
  transition: opacity 0.3s ease-in-out;
}

/* General modal open animation helper (paired with .open) */
/* .modal-animate and .modal-animate.open already exist above; keep reusing them */

/* Page transition animations */
.page-fade-in {
  animation: pageFadeIn 0.35s ease-out both;
}
.page-fade-out {
  animation: pageFadeOut 0.2s ease-in both;
}
@keyframes pageFadeIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes pageFadeOut {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(6px); }
} 