/* ===================================================
   TUTOR TRANSACTION STYLES (tutor-transaction.css)
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary-blue: #2563eb;
  --bg-main: #f8fafc;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #f1f5f9;
  --card-border: #e2e8f0;
  
  /* Transaction specific colors */
  --green-bg: #dcfce7;
  --green-text: #16a34a;
  --red-bg: #fee2e2;
  --red-text: #dc2626;

  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

/* ================= MAIN CONTENT & LAYOUT FIX ================= */
.main-content {
  margin-left: 260px; /* Sidebar offset space */
  flex: 1;
  padding: 32px 40px 40px 40px;
  max-width: 1300px;
  width: calc(100% - 260px);
}

/* ================= TOP HEADER & USER PROFILE FIX ================= */
.top-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Notification Button Fix */
.icon-btn {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.icon-btn:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #ffffff;
}

/* Profile Picture & Info Fix (Screen Exploding Issue Solved) */
.header-user-profile, 
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: #ffffff;
  padding: 6px 14px 6px 6px;
  border-radius: 30px;
  border: 1px solid var(--card-border);
}

/* Avatar Image Clamp */
.avatar-small,
.header-user-profile img,
.user-profile img {
  width: 38px !important;
  height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0;
}

.profile-meta,
.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.profile-meta .name,
.user-info .name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.profile-meta .role,
.user-info .role {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-user-profile .chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* ================= PAGE HEADER ================= */
.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ================= TRANSACTION CARD & TABLE ================= */
.transaction-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 24px;
}

/* Filters Bar Fix */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.date-filter {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 30px;
  padding: 0 14px;
}

.date-filter i {
  color: var(--text-muted);
  font-size: 14px;
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 36px 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 30px;
  outline: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.date-filter .filter-select {
  border: none;
  padding-left: 8px;
}

/* Table Design */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.transaction-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.transaction-table th {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.transaction-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.transaction-table tr:last-child td {
  border-bottom: none;
}

.text-center {
  text-align: center;
}

/* Date & Icon Formatting */
.date-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-box,
.tx-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.icon-added,
.icon-box.icon-added {
  background-color: var(--green-bg);
  color: var(--green-text);
}

.icon-used,
.icon-box.icon-used {
  background-color: var(--red-bg);
  color: var(--red-text);
}

.date-cell .date {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.date-cell .time {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

/* Type Cell Badges */
.type-text {
  font-size: 13px;
  font-weight: 700;
}

.type-added {
  color: var(--green-text);
}

.type-used {
  color: var(--red-text);
}

/* Description Cell */
.desc-cell .title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.desc-cell .subtext {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

/* Credits Amount */
.credit-amount {
  font-size: 14px;
  font-weight: 800;
}

.amount-added,
.credit-amount.positive {
  color: var(--green-text);
}

.amount-used,
.credit-amount.negative {
  color: var(--red-text);
}

/* Status Badges */
.status-pill,
.status-completed {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background-color: var(--green-bg);
  color: var(--green-text);
}

/* Security Footer */
.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.security-note i {
  color: var(--green-text);
  font-size: 15px;
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 992px) {
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 20px 16px;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .select-wrapper,
  .date-filter,
  .filter-select {
    width: 100%;
  }
}
