
/* Custom styles for Paisa Accounting */
:root {
  --primary-color: #3b82f6;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
}

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

/* Compact Layout - Reduce whitespace globally */
/* Override Bootstrap heading margins and line-heights */
h1, .h1 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  line-height: 1.2;
  font-size: 1.5rem;
}

h2, .h2 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  font-size: 1.25rem;
}

h3, .h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  font-size: 1.125rem;
}

h4, .h4 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  font-size: 1rem;
}

h5, .h5 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  line-height: 1.4;
  font-size: 0.875rem;
}

h6, .h6 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  line-height: 1.4;
  font-size: 0.875rem;
}

/* Reduce Bootstrap card padding */
.card {
  padding: 0.75rem !important;
}

.card-body {
  padding: 0.75rem !important;
}

/* Reduce Bootstrap row margins */
.row {
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.row > * {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* Compact spacing utilities */
.compact-p {
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.compact-section {
  margin-bottom: 1rem;
}

.compact-header {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0;
}

/* Override large padding/margin utilities */
.py-4 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.py-5 {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

.mb-4 {
  margin-bottom: 0.75rem !important;
}

.mb-5 {
  margin-bottom: 1rem !important;
}

.mb-6 {
  margin-bottom: 1rem !important;
}

/* Reduce default paragraph margins */
p {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* Compact form groups */
.form-group {
  margin-bottom: 0.75rem;
}

/* Reduce table cell padding */
.table td, .table th {
  padding: 0.5rem 0.75rem !important;
}

/* Compact grid gaps */
.gap-4 {
  gap: 0.75rem !important;
}

.gap-6 {
  gap: 1rem !important;
}

/* Form styling - Enhanced visibility with prominent borders */
.form-input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
input[type="search"],
select,
textarea,
.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 2px solid #94a3b8 !important; /* More visible border - slate-400 */
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: #ffffff !important;
  color: #1f2937;
  transition: all 0.2s ease;
  height: 2.25rem; /* Consistent height for inputs */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* Subtle shadow for depth */
}

textarea {
  height: auto !important;
  min-height: 4rem;
  resize: vertical;
}

/* Remove browser default arrows from all selects */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Add custom arrow only to visible selects */
select:not([style*="display: none"]):not([style*="display:none"]):not(.hidden) {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Enhanced focus state - Very prominent */
.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus,
.form-control:focus {
  outline: none !important;
  border-color: #3b82f6 !important; /* Blue-500 - prominent */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important; /* Stronger blue glow */
  background-color: #ffffff !important;
}

/* Hover state for better interactivity */
.form-input:hover:not(:focus),
input[type="text"]:hover:not(:focus),
input[type="email"]:hover:not(:focus),
input[type="tel"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
input[type="password"]:hover:not(:focus),
input[type="date"]:hover:not(:focus),
input[type="datetime-local"]:hover:not(:focus),
input[type="url"]:hover:not(:focus),
input[type="search"]:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus),
.form-control:hover:not(:focus) {
  border-color: #64748b !important; /* Slightly darker on hover */
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Placeholder styling */
.form-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: #94a3b8; /* Lighter gray for placeholders */
  opacity: 1;
}

/* Override Bootstrap form-control if used */
.form-control {
  border-width: 2px !important;
}

.form-control:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

/* Override Tailwind border utilities for form inputs */
input.border-gray-300,
textarea.border-gray-300,
select.border-gray-300 {
  border: 2px solid #94a3b8 !important; /* Override gray-300 with more visible slate-400 */
}

input.border-gray-300:focus,
textarea.border-gray-300:focus,
select.border-gray-300:focus {
  border-color: #3b82f6 !important; /* Blue-500 on focus */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

input.border-gray-300:hover:not(:focus),
textarea.border-gray-300:hover:not(:focus),
select.border-gray-300:hover:not(:focus) {
  border-color: #64748b !important; /* Darker on hover */
}

/* Override any border class on inputs */
input[class*="border"],
textarea[class*="border"],
select[class*="border"] {
  border-width: 2px !important;
}

input[class*="border"]:focus,
textarea[class*="border"]:focus,
select[class*="border"]:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

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

/* Primary action buttons - Standardized blue */
.btn-primary {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  background-color: #2563eb;
  border-radius: 0.5rem;
  transition: all 0.2s;
  border: none;
  box-shadow: none;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

/* Secondary/Cancel buttons - Gray instead of pink */
.btn-secondary {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  transition: all 0.2s;
  box-shadow: none;
}

.btn-secondary:hover {
  background-color: #f9fafb;
}

/* Action button variants */
.btn-success {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  background-color: #16a34a;
  border-radius: 0.5rem;
  transition: all 0.2s;
  border: none;
  box-shadow: none;
}

.btn-success:hover {
  background-color: #15803d;
}

.btn-danger {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  background-color: #dc2626;
  border-radius: 0.5rem;
  transition: all 0.2s;
  border: none;
  box-shadow: none;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-warning {
  @apply bg-yellow-600 hover:bg-yellow-700 text-white font-semibold py-2 px-4 rounded-lg shadow-md hover:shadow-lg transition-all duration-200;
}

/* Standardized action buttons - Uniform size and color */
.btn-add, .btn-create, .btn-update, .btn-edit, .btn-save {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  background-color: #2563eb;
  border-radius: 0.5rem;
  transition: all 0.2s;
  border: none;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
}

.btn-add:hover, .btn-create:hover, .btn-update:hover, .btn-edit:hover, .btn-save:hover {
  background-color: #1d4ed8;
}

.btn-delete {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  background-color: #dc2626;
  border-radius: 0.5rem;
  transition: all 0.2s;
  border: none;
  box-shadow: none;
}

.btn-delete:hover {
  background-color: #b91c1c;
}

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

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

.table th {
  @apply px-6 py-3 bg-gray-50 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;
}

/* Card styling */
.card {
  @apply bg-white rounded-lg shadow-md p-6;
}

.card-header {
  @apply border-b border-gray-200 pb-4 mb-4;
}

.card-title {
  @apply text-lg font-semibold text-gray-900;
}

/* Navigation */
.nav-link {
  @apply flex items-center px-4 py-2 text-sm font-medium rounded-md transition duration-200;
}

.nav-link-active {
  @apply bg-blue-100 text-blue-700;
}

.nav-link:hover {
  @apply bg-gray-100 text-gray-900;
}

/* Sidebar Links - handled in HTML via utility classes due to no build step */
/*
.sidebar-link {
  @apply flex items-center px-3 py-2 text-gray-700 hover:bg-blue-50 hover:text-blue-700 rounded-md transition-colors;
}

.sidebar-link-active {
  @apply bg-blue-100 text-blue-800 font-semibold shadow-sm border-l-4 border-blue-600 rounded-l-none;
}
*/

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

.badge-warning {
  @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800;
}

.badge-error {
  @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800;
}

.badge-info {
  @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800;
}

/* Modal styling */
.modal {
  @apply fixed inset-0 z-50 overflow-y-auto;
}

.modal-backdrop {
  @apply fixed inset-0 bg-black bg-opacity-50;
}

.modal-content {
  @apply relative bg-white rounded-lg shadow-xl max-w-lg mx-auto mt-20;
}

/* Loading spinner */
.spinner {
  @apply animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600;
}

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

.shadow-custom {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
