/**
 * HOSTPN Financial Management Styles
 *
 * Styles for financial dashboard, import modal, and data tables.
 *
 * @package    hostpn
 * @subpackage hostpn/assets/css/admin
 * @since      1.0.36
 */

/* ========================================
   Financial Dashboard Wrapper
   ======================================== */

.hostpn-financial-dashboard-wrapper {
  margin-top: 20px;
}

/* ========================================
   Summary Cards
   ======================================== */

.hostpn-financial-summary-cards {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.hostpn-financial-card {
  flex: 1;
  min-width: 200px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hostpn-financial-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.hostpn-financial-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.hostpn-financial-card-income .hostpn-financial-card-icon {
  background-color: #e8f5e9;
  color: #4caf50;
}

.hostpn-financial-card-expenses .hostpn-financial-card-icon {
  background-color: #ffebee;
  color: #f44336;
}

.hostpn-financial-card-net .hostpn-financial-card-icon {
  background-color: #e3f2fd;
  color: #2196f3;
}

.hostpn-financial-card-records .hostpn-financial-card-icon {
  background-color: #fff3e0;
  color: #ff9800;
}

.hostpn-financial-card-content {
  flex: 1;
}

.hostpn-financial-card-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.hostpn-financial-card-value {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}

/* ========================================
   Filters
   ======================================== */

.hostpn-financial-filters {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.hostpn-financial-filters-row {
  display: flex;
  gap: 15px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.hostpn-financial-filter-item {
  flex: 1;
  min-width: 150px;
}

.hostpn-financial-filter-item label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 13px;
  color: #555;
}

.hostpn-financial-filter {
  width: 100%;
}

/* ========================================
   Data Table
   ======================================== */

.hostpn-financial-table-wrapper {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.hostpn-financial-table {
  width: 100%;
  border-collapse: collapse;
}

.hostpn-financial-table thead {
  background: #f5f5f5;
}

.hostpn-financial-table th {
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #555;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
}

.hostpn-financial-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  color: #333;
}

.hostpn-financial-table tbody tr:hover {
  background-color: #f9f9f9;
}

.hostpn-financial-table tbody tr:last-child td {
  border-bottom: none;
}

/* Column specific styles */
.hostpn-financial-th-date,
.hostpn-financial-td-date {
  width: 100px;
}

.hostpn-financial-th-platform,
.hostpn-financial-td-platform {
  width: 120px;
}

.hostpn-financial-th-type,
.hostpn-financial-td-type {
  width: 100px;
}

.hostpn-financial-th-amount,
.hostpn-financial-td-amount {
  width: 120px;
  font-weight: 600;
}

.hostpn-financial-th-actions,
.hostpn-financial-td-actions {
  width: 100px;
}

/* ========================================
   Badges
   ======================================== */

.hostpn-financial-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.hostpn-financial-badge-airbnb {
  background-color: #ff5a5f;
  color: #fff;
}

.hostpn-financial-badge-booking {
  background-color: #003580;
  color: #fff;
}

.hostpn-financial-badge-manual {
  background-color: #666;
  color: #fff;
}

.hostpn-financial-badge-income {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.hostpn-financial-badge-expense {
  background-color: #ffebee;
  color: #c62828;
}

.hostpn-financial-badge-tax {
  background-color: #fff3e0;
  color: #e65100;
}

.hostpn-financial-badge-fee {
  background-color: #f3e5f5;
  color: #6a1b9a;
}

.hostpn-financial-badge-airbnb_fiscal {
  background-color: #ffebee;
  color: #c62828;
}

.hostpn-financial-badge-airbnb_invoice {
  background-color: #e8f5e9;
  color: #2e7d32;
}

/* ========================================
   Pagination
   ======================================== */

.hostpn-financial-pagination {
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
}

.hostpn-financial-pagination-btn {
  min-width: 35px;
  height: 35px;
  padding: 5px 10px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.hostpn-financial-pagination-btn:hover {
  background: #f5f5f5;
  border-color: #999;
}

.hostpn-financial-pagination-btn.active {
  background: #2196f3;
  color: #fff;
  border-color: #2196f3;
  font-weight: 600;
}

/* ========================================
   Import Modal
   ======================================== */

.hostpn-financial-import-modal {
  max-width: 600px;
  min-height: 400px;
}

.hostpn-financial-file-drop-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  background: #fafafa;
}

.hostpn-financial-file-drop-zone:hover,
.hostpn-financial-file-drop-zone.hostpn-drag-over {
  border-color: #2196f3;
  background: #e3f2fd;
}

.hostpn-financial-drop-icon {
  font-size: 64px;
  color: #999;
  display: block;
  margin-bottom: 15px;
}

.hostpn-financial-drop-text {
  font-size: 16px;
  color: #666;
  margin-bottom: 10px;
}

.hostpn-financial-file-label {
  color: #2196f3;
  text-decoration: underline;
  cursor: pointer;
}

.hostpn-financial-file-label:hover {
  color: #1976d2;
}

.hostpn-financial-file-limits {
  font-size: 12px;
  color: #999;
}

.hostpn-financial-import-supported {
  background: #f0f8ff;
  padding: 15px;
  border-radius: 6px;
  border-left: 4px solid #2196f3;
  margin: 15px 0;
}

.hostpn-financial-import-supported ul {
  margin: 10px 0 0 20px;
  list-style: disc;
}

.hostpn-financial-import-supported li {
  margin: 5px 0;
}

.hostpn-financial-import-detected {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 6px;
  margin-bottom: 20px;
}

.hostpn-financial-preview-wrapper {
  max-height: 300px;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.hostpn-financial-import-success {
  text-align: center;
  padding: 30px;
}

.hostpn-financial-success-icon {
  font-size: 64px;
  color: #4caf50;
  display: block;
  margin-bottom: 15px;
}

.hostpn-financial-import-stats p {
  margin: 10px 0;
  font-size: 16px;
}

.hostpn-financial-import-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

/* ========================================
   Edit Modal
   ======================================== */

.hostpn-financial-edit-modal {
  max-width: 700px;
}

.hostpn-financial-edit-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.hostpn-financial-edit-col {
  flex: 1;
}

.hostpn-financial-edit-col label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 13px;
  color: #555;
}

.hostpn-financial-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

/* ========================================
   Button Styles
   ======================================== */

.hostpn-financial-import-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hostpn-btn-icon {
  background: transparent;
  border: none;
  padding: 5px;
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
  line-height: 1;
}

.hostpn-btn-icon:hover {
  color: #2196f3;
}

.hostpn-financial-record-delete:hover {
  color: #f44336;
}

.hostpn-btn-icon i {
  font-size: 20px;
}

/* ========================================
   Import History
   ======================================== */

.hostpn-financial-import-history {
  margin-top: 30px;
}

.hostpn-financial-import-history h3 {
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* ========================================
   Alerts
   ======================================== */

.hostpn-alert {
  padding: 15px 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
}

.hostpn-alert-error {
  background-color: #ffebee;
  border-left: 4px solid #f44336;
  color: #c62828;
}

.hostpn-alert i {
  font-size: 24px;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1024px) {
  .hostpn-financial-summary-cards {
    flex-wrap: wrap;
  }

  .hostpn-financial-card {
    min-width: calc(50% - 10px);
  }

  .hostpn-financial-filters-row {
    flex-direction: column;
  }

  .hostpn-financial-filter-item {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .hostpn-financial-card {
    min-width: 100%;
  }

  .hostpn-financial-table {
    font-size: 12px;
  }

  .hostpn-financial-table th,
  .hostpn-financial-table td {
    padding: 8px 10px;
  }

  .hostpn-financial-edit-row {
    flex-direction: column;
  }

  .hostpn-financial-import-detected {
    flex-direction: column;
  }
}

/* ========================================
   Loading States
   ======================================== */

.hostpn-financial-upload-progress,
.hostpn-financial-edit-loading {
  padding: 40px 20px;
}

/* ========================================
   Popup Overrides for Financial
   ======================================== */

#hostpn-popup-financial-import .hostpn-popup-content,
#hostpn-popup-financial-edit .hostpn-popup-content {
  max-height: 90vh;
  overflow-y: auto;
}

.hostpn-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 15px;
  border-bottom: 1px solid #eee;
}

.hostpn-popup-header h2 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.hostpn-popup-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  color: #666;
  transition: color 0.2s;
}

.hostpn-popup-close:hover {
  color: #333;
}

.hostpn-popup-body {
  padding: 20px;
}

/* ========================================
   Export Button
   ======================================== */

.hostpn-financial-export-wrapper {
  padding: 15px;
  border-top: 1px solid #eee;
}

.hostpn-financial-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
