/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require ledgerhq-layout
 *= require transactions
 *= require reports
 *= require financial-statements
 *= require client_info
 *= require_self
 */

/* LedgerHQ uses its own CSS system - Bootstrap removed to avoid conflicts */

/* Only essential Rails-specific styles */
.field_with_errors {
  display: contents;
}

.field_with_errors input,
.field_with_errors textarea,
.field_with_errors select {
  border-color: var(--error-color, #ef4444);
  box-shadow: 0 0 0 0.25rem rgba(239, 68, 68, 0.25);
}

/* ===============================================
   Consistent Header Buttons
   =============================================== */

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.5;
    white-space: nowrap;
}

.header-btn:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #9ca3af;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.header-btn-icon {
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-btn-text {
    font-size: 0.875rem;
}

.header-btn-back {
    /* Specific styles for Back to Clients button */
}

.header-btn-help {
    /* Specific styles for Help Center button */
}

.header-btn-help .header-btn-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-btn-help:hover .header-btn-icon {
    background: #3b82f6;
    color: white;
}

.header-left-buttons,
.header-right-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===============================================
   Client Switcher Component
   =============================================== */

.client-switcher {
    position: relative;
    min-width: 300px;
    max-width: 500px;
    width: 100%;
}

.client-search-input {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--gray-200, #e5e7eb);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-search-input:hover {
    border-color: var(--primary-dark, #5a67d8);
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

.client-search-input.active {
    border-color: var(--primary-dark, #5a67d8);
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

.client-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--gray-300, #d1d5db) !important;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 0.25rem;
    max-height: 400px;
    overflow-y: auto;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.client-option {
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.client-option:hover {
    background-color: var(--gray-50, #f9fafb);
}

.client-option:last-child {
    border-bottom: none;
}

.client-option-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
}

.client-name {
    font-weight: 500;
    color: var(--gray-900, #111827);
    font-size: 0.875rem;
}

.client-meta {
    font-size: 0.75rem;
    color: var(--gray-500, #6b7280);
    margin-top: 0.125rem;
}

/* Client Avatar Gradients */
.client-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.client-avatar.gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.client-avatar.gradient-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.client-avatar.gradient-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.client-avatar.gradient-4 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.client-avatar.gradient-5 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.client-avatar.gradient-6 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }

/* Dropdown sections */
.dropdown-section {
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
    background: white;
}

.dropdown-section:last-child {
    border-bottom: none;
}

.dropdown-section:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.dropdown-section:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.section-header {
    padding: 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* Search input focus states */
#clientSearchFilter:focus {
    border-color: var(--primary-dark, #5a67d8);
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .client-switcher {
        min-width: 250px;
        max-width: 300px;
    }
    
    .client-dropdown {
        max-height: 300px;
    }
}

/* Custom scrollbar for dropdown */
.client-dropdown::-webkit-scrollbar {
    width: 6px;
}

.client-dropdown::-webkit-scrollbar-track {
    background: var(--gray-100, #f3f4f6);
    border-radius: 3px;
}

.client-dropdown::-webkit-scrollbar-thumb {
    background: var(--gray-300, #d1d5db);
    border-radius: 3px;
}

.client-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400, #9ca3af);
}

/* Matching States for JavaScript-based matching */
.transaction-card.selected-for-matching {
  background-color: #e6f3ff !important;
  border: 2px solid #0066cc !important;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2) !important;
}

.select-statement-btn.selected {
  background-color: #0066cc !important;
  color: white !important;
}

.match-register-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.match-register-btn:not(.disabled):hover {
  background-color: #0066cc;
  color: white;
}

.matching-message {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  font-weight: 500;
  display: none;
}

.matching-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.matching-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}