/* account.css - Account dashboard, billing, and tickets styles */

.account-section {
  padding: 40px 40px 80px;
  max-width: 900px;
  margin: 0 auto;
}

.account-card {
  background: rgba(20, 22, 32, 0.8);
  border: 1px solid rgba(78, 140, 255, 0.1);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.account-card h2 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.account-card p {
  color: #8888a0;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(91, 155, 255, 0.3);
}

.username {
  font-size: 1.3rem;
  font-weight: 600;
  background: linear-gradient(135deg, #5b9bff, #7c4dff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-logout {
  background: rgba(255, 82, 82, 0.1);
  border: 1px solid rgba(255, 82, 82, 0.3);
  color: #ff5252;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.btn-logout:hover {
  background: rgba(255, 82, 82, 0.2);
}

/* Account Dashboard Tabs */
.account-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.account-tab {
  background: rgba(20, 22, 32, 0.8);
  border: 1px solid rgba(78, 140, 255, 0.1);
  color: #8888a0;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.25s;
}

.account-tab:hover {
  color: #e0e0e8;
  border-color: rgba(91, 155, 255, 0.25);
}

.account-tab.active {
  background: rgba(91, 155, 255, 0.12);
  color: #5b9bff;
  border-color: rgba(91, 155, 255, 0.3);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Error alert for login errors */
.error-alert {
  background: rgba(255, 82, 82, 0.1);
  border: 1px solid rgba(255, 82, 82, 0.3);
  color: #ff5252;
  padding: 12px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 0.9rem;
}

/* Invoices */
.invoices-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.invoice-card {
  background: rgba(20, 22, 32, 0.8);
  border: 1px solid rgba(78, 140, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: 0.3s;
}

.invoice-card:hover {
  border-color: rgba(91, 155, 255, 0.2);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  flex-wrap: wrap;
  gap: 10px;
}

.invoice-id {
  font-weight: 700;
  font-size: 0.95rem;
  color: #e0e0e8;
}

.invoice-date {
  color: #666;
  font-size: 0.8rem;
}

.invoice-body {
  padding: 0 22px 18px;
}

.invoice-desc {
  color: #8888a0;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.invoice-items {
  margin-bottom: 12px;
}

.invoice-items table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-items th,
.invoice-items td {
  text-align: left;
  padding: 8px 10px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(78, 140, 255, 0.06);
}

.invoice-items th {
  color: #8888a0;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.invoice-items td {
  color: #c0c0d0;
}

.invoice-items td:last-child,
.invoice-items th:last-child {
  text-align: right;
}

.invoice-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-top: 1px solid rgba(78, 140, 255, 0.06);
  background: rgba(10, 10, 20, 0.3);
  flex-wrap: wrap;
  gap: 10px;
}

.invoice-amount {
  font-size: 1.4rem;
  font-weight: 700;
  color: #5b9bff;
}

.invoice-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pending {
  background: rgba(255, 171, 64, 0.12);
  color: #ffab40;
}

.status-payment_submitted {
  background: rgba(91, 155, 255, 0.12);
  color: #5b9bff;
}

.status-paid {
  background: rgba(105, 240, 174, 0.12);
  color: #69f0ae;
}

.status-overdue {
  background: rgba(255, 82, 82, 0.12);
  color: #ff5252;
}

.status-cancelled {
  background: rgba(136, 136, 160, 0.12);
  color: #8888a0;
}

.btn-pay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #69f0ae, #00c853);
  color: #0a0a0f;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s;
}

.btn-pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(105, 240, 174, 0.35);
}

.btn-pay:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Tickets */
.tickets-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ticket-card {
  background: rgba(20, 22, 32, 0.8);
  border: 1px solid rgba(78, 140, 255, 0.08);
  border-radius: 14px;
  padding: 18px 22px;
  cursor: pointer;
  transition: 0.3s;
}

.ticket-card:hover {
  border-color: rgba(91, 155, 255, 0.25);
  transform: translateY(-2px);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.ticket-id {
  font-weight: 600;
  font-size: 0.85rem;
  color: #8888a0;
}

.ticket-subject {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e0e0e8;
  margin-bottom: 4px;
}

.ticket-meta {
  display: flex;
  gap: 14px;
  font-size: 0.8rem;
  color: #666;
}

.ticket-category {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(124, 77, 255, 0.08);
  color: #a78bfa;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
}

.status-open {
  background: rgba(91, 155, 255, 0.12);
  color: #5b9bff;
}

.status-in-progress {
  background: rgba(255, 171, 64, 0.12);
  color: #ffab40;
}

.status-closed {
  background: rgba(136, 136, 160, 0.12);
  color: #8888a0;
}

/* Ticket Detail View */
.ticket-detail {
  background: rgba(20, 22, 32, 0.8);
  border: 1px solid rgba(78, 140, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
}

.ticket-detail-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(78, 140, 255, 0.06);
}

.ticket-detail-header h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.ticket-detail-meta {
  display: flex;
  gap: 14px;
  font-size: 0.8rem;
  color: #666;
  flex-wrap: wrap;
}

.ticket-messages {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 400px;
  overflow-y: auto;
}

.ticket-msg {
  padding: 12px 16px;
  border-radius: 10px;
  max-width: 85%;
}

.ticket-msg.user-msg {
  background: rgba(91, 155, 255, 0.08);
  border: 1px solid rgba(91, 155, 255, 0.12);
  align-self: flex-end;
}

.ticket-msg.admin-msg {
  background: rgba(124, 77, 255, 0.08);
  border: 1px solid rgba(124, 77, 255, 0.12);
  align-self: flex-start;
}

.ticket-msg-author {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.user-msg .ticket-msg-author {
  color: #5b9bff;
}

.admin-msg .ticket-msg-author {
  color: #a78bfa;
}

.ticket-msg-content {
  color: #c0c0d0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.ticket-msg-time {
  font-size: 0.7rem;
  color: #555;
  margin-top: 4px;
}

.ticket-reply-form {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid rgba(78, 140, 255, 0.06);
  background: rgba(10, 10, 20, 0.3);
}

.ticket-reply-form textarea {
  flex: 1;
  background: rgba(10, 10, 20, 0.5);
  border: 1px solid rgba(78, 140, 255, 0.12);
  color: #e0e0e8;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  resize: none;
  min-height: 44px;
  font-family: inherit;
}

.ticket-reply-form textarea:focus {
  outline: none;
  border-color: rgba(91, 155, 255, 0.3);
}

.ticket-reply-form button {
  padding: 10px 20px;
  background: linear-gradient(135deg, #5b9bff, #7c4dff);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.3s;
  align-self: flex-end;
}

.ticket-reply-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91, 155, 255, 0.3);
}

/* Back button for ticket detail */
.back-btn {
  background: none;
  border: none;
  color: #5b9bff;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  transition: 0.2s;
}

.back-btn:hover {
  color: #7cb3ff;
}

/* New ticket form */
.new-ticket-form {
  background: rgba(20, 22, 32, 0.8);
  border: 1px solid rgba(78, 140, 255, 0.1);
  border-radius: 16px;
  padding: 28px;
}

.new-ticket-form h3 {
  font-size: 1.15rem;
  margin-bottom: 16px;
}

.new-ticket-form label {
  display: block;
  color: #8888a0;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  margin-top: 14px;
}

.new-ticket-form label:first-of-type {
  margin-top: 0;
}

.new-ticket-form input,
.new-ticket-form select,
.new-ticket-form textarea {
  width: 100%;
  background: rgba(10, 10, 20, 0.5);
  border: 1px solid rgba(78, 140, 255, 0.12);
  color: #e0e0e8;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: inherit;
}

.new-ticket-form input:focus,
.new-ticket-form select:focus,
.new-ticket-form textarea:focus {
  outline: none;
  border-color: rgba(91, 155, 255, 0.3);
}

.new-ticket-form select {
  cursor: pointer;
}

.new-ticket-form select option {
  background: #14162a;
}

.new-ticket-form textarea {
  resize: vertical;
  min-height: 80px;
}

.form-submit-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-submit {
  padding: 12px 28px;
  background: linear-gradient(135deg, #5b9bff, #7c4dff);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.3s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(91, 155, 255, 0.4);
}

.btn-cancel {
  padding: 12px 28px;
  background: rgba(136, 136, 160, 0.1);
  border: 1px solid rgba(136, 136, 160, 0.2);
  color: #8888a0;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.3s;
}

.btn-cancel:hover {
  background: rgba(136, 136, 160, 0.2);
}

/* Section header with action */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-size: 1.3rem;
  margin: 0;
}

.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #5b9bff, #7c4dff);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.btn-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91, 155, 255, 0.3);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #555;
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 16px;
}

/* Loading spinner */
.loading {
  text-align: center;
  padding: 40px;
  color: #8888a0;
}

/* Status message */
.status-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

.status-toast.success {
  background: rgba(105, 240, 174, 0.15);
  border: 1px solid rgba(105, 240, 174, 0.3);
  color: #69f0ae;
}

.status-toast.error {
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid rgba(255, 82, 82, 0.3);
  color: #ff5252;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Pay modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  background: #14162a;
  border: 1px solid rgba(78, 140, 255, 0.15);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.modal-box h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.modal-box p {
  color: #8888a0;
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

@media (max-width: 768px) {
  .account-section {
    padding: 30px 16px 60px;
  }

  .account-card {
    padding: 28px 20px;
  }

  .invoice-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .invoice-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .ticket-msg {
    max-width: 95%;
  }
}
