/* Huddle Creative PM - Custom Styles */

/* Global overrides */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Sidebar styles */
.sidebar {
  transition: all 0.3s ease-in-out;
}

.sidebar-item {
  transition: all 0.2s ease-in-out;
}

.sidebar-item:hover {
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: 0.375rem;
}

.sidebar-item.active {
  background-color: rgb(59, 130, 246);
  color: white;
  border-radius: 0.375rem;
}

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

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Status badges */
.status-badge {
  @apply px-3 py-1 rounded-full text-sm font-medium;
}

.status-todo {
  @apply bg-gray-100 text-gray-800;
}

.status-in-progress {
  @apply bg-blue-100 text-blue-800;
}

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

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

/* Priority badges */
.priority-low {
  @apply bg-green-100 text-green-800;
}

.priority-medium {
  @apply bg-yellow-100 text-yellow-800;
}

.priority-high {
  @apply bg-red-100 text-red-800;
}

/* Modal styles */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

/* Form styles */
.form-group {
  @apply mb-6;
}

.form-label {
  @apply block text-sm font-medium text-gray-700 mb-2;
}

.form-input {
  @apply w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500;
}

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

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

/* Button styles */
.btn {
  @apply px-4 py-2 rounded-md font-medium text-sm transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2;
}

.btn-primary {
  @apply bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500;
}

.btn-secondary {
  @apply bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500;
}

.btn-success {
  @apply bg-green-600 text-white hover:bg-green-700 focus:ring-green-500;
}

.btn-danger {
  @apply bg-red-600 text-white hover:bg-red-700 focus:ring-red-500;
}

.btn-outline {
  @apply bg-white text-gray-700 border border-gray-300 hover:bg-gray-50 focus:ring-gray-500;
}

/* Table styles */
.table-container {
  @apply overflow-x-auto shadow ring-1 ring-black ring-opacity-5 md:rounded-lg;
}

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

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

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

.table-body {
  @apply bg-white divide-y divide-gray-200;
}

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

.table-row {
  @apply hover:bg-gray-50 transition-colors duration-150;
}

/* Grid styles for team view */
.grid-container {
  @apply grid gap-6;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Notification styles */
.notification {
  @apply fixed top-4 right-4 max-w-sm w-full bg-white border border-gray-200 rounded-lg shadow-lg z-50 transform transition-all duration-300;
}

.notification.show {
  @apply translate-x-0 opacity-100;
}

.notification.hide {
  @apply translate-x-full opacity-0;
}

.notification-success {
  @apply border-green-200 bg-green-50;
}

.notification-error {
  @apply border-red-200 bg-red-50;
}

.notification-info {
  @apply border-blue-200 bg-blue-50;
}

.notification-warning {
  @apply border-yellow-200 bg-yellow-50;
}

/* Currency input styles */
.currency-input {
  @apply pl-8;
}

.currency-symbol {
  @apply absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500;
}

/* Loading states */
.loading {
  @apply opacity-50 pointer-events-none;
}

.spinner {
  @apply animate-spin rounded-full h-4 w-4 border-b-2 border-current;
}

/* Responsive design improvements */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }

  /* Ensure main content takes full width on mobile */
  #content {
    margin-left: 0 !important;
  }

  /* Stack buttons vertically on mobile */
  .mobile-stack {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Hide sidebar user section text on very small screens */
  .sidebar-user-text {
    display: none;
  }
}

/* iPad and small laptop optimizations (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Ensure sidebar stays visible */
  .sidebar {
    position: fixed;
    z-index: 40;
  }

  /* Adjust main content margin for iPad */
  #content {
    margin-left: 16rem; /* 64 * 0.25rem = 16rem */
  }

  /* Optimize header for smaller screens */
  .header-actions {
    gap: 0.75rem;
  }

  /* Ensure notifications dropdown doesn't overflow */
  #notifications-dropdown {
    right: 0;
    max-width: 20rem;
  }

  /* Responsive project grid for iPad */
  .project-grid-responsive {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Adjust modal width for iPad */
  .modal-content {
    max-width: 90vw;
    margin: 1rem;
  }
}

/* Large screens (1024px+) - ensure proper spacing */
@media (min-width: 1024px) {
  /* Ensure user profile section is always visible */
  .sidebar-user-section {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
  }

  /* Notifications dropdown positioning */
  #notifications-dropdown {
    right: 0;
    max-width: 24rem;
  }
}

/* Ensure CTAs and notifications are always visible */
.header-fixed {
  position: sticky;
  top: 0;
  z-index: 30;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

/* Profile section always visible at bottom */
.profile-fixed {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
}

/* Responsive text truncation */
.text-truncate-responsive {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .text-truncate-responsive {
    max-width: 120px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .text-truncate-responsive {
    max-width: 200px;
  }
}

/* Responsive buttons */
.btn-responsive {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .btn-responsive {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
}

/* Grid responsive breakpoints */
.grid-responsive-1-2-3 {
  display: grid;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .grid-responsive-1-2-3 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .grid-responsive-1-2-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1025px) {
  .grid-responsive-1-2-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}