/* ===== MEMBER PORTAL STYLES ===== */

:root {
  --member-primary: #2E7D32;
  --member-secondary: #4CAF50;
  --member-accent: #FFC107;
  --member-bg: #F1F8E9;
  --member-card: #ffffff;
  --member-text: #2d3748;
  --member-text-light: #757575;
  --member-border: #C8E6C9;
  --member-success: #4CAF50;
  --member-warning: #FF9800;
  --member-danger: #E74C3C;
}

/* Body */
.member-portal {
  background: var(--member-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.member-header {
  background: linear-gradient(135deg, var(--member-primary), var(--member-secondary));
  color: white;
  padding: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.logo-image-container {
  position: relative;
  width: 60px;
  height: 60px;
}

.logo-image-container img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid white;
}

.logo-circle {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--member-accent);
}

.logo-info h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-info p {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.user-avatar i {
  width: 24px;
  height: 24px;
  color: white;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.user-role {
  font-size: 13px;
  opacity: 0.9;
  white-space: nowrap;
}

/* Member Date Info */
.member-date-info {
  background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 139, 139, 0.2);
}

.member-date-info i {
  width: 18px;
  height: 18px;
  color: #FFD700;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.btn-logout:hover {
  background: white;
  color: var(--member-primary);
}

.btn-logout i {
  width: 18px;
  height: 18px;
}

/* Navigation */
.member-nav {
  background: white;
  border-bottom: 1px solid var(--member-border);
  position: sticky;
  top: 100px;
  z-index: 99;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.nav-item {
  background: transparent;
  border: none;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--member-text-light);
  font-weight: 500;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--member-primary);
  background: rgba(0, 139, 139, 0.05);
}

.nav-item.active {
  color: var(--member-primary);
  border-bottom-color: var(--member-primary);
  font-weight: 600;
}

.nav-item i {
  width: 20px;
  height: 20px;
}

/* Main Content */
.member-content {
  flex: 1;
  padding: 32px 0;
}

.content-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Dashboard Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card-member {
  background: var(--member-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  border-left: 4px solid var(--member-primary);
}

.stat-card-member:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-card-member.success {
  border-left-color: var(--member-success);
}

.stat-card-member.warning {
  border-left-color: var(--member-warning);
}

.stat-card-member.danger {
  border-left-color: var(--member-danger);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--member-primary), var(--member-secondary));
}

.stat-icon i {
  width: 24px;
  height: 24px;
  color: white;
}

.stat-body h3 {
  font-size: 14px;
  color: var(--member-text-light);
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--member-text);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--member-text-light);
}

/* Profile Card */
.profile-card {
  background: var(--member-card);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--member-border);
}

.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--member-primary), var(--member-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
}

.profile-avatar-large i {
  width: 60px;
  height: 60px;
  color: white;
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-info h2 {
  font-size: 28px;
  color: var(--member-text);
  margin-bottom: 8px;
}

.profile-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #DAA520;
  font-size: 14px;
  font-weight: 500;
}

.meta-item i {
  width: 16px;
  height: 16px;
  color: var(--member-primary);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.profile-field {
  margin-bottom: 16px;
}

.profile-field label {
  display: block;
  font-size: 13px;
  color: var(--member-text-light);
  margin-bottom: 6px;
  font-weight: 500;
}

.profile-field .value {
  font-size: 16px;
  color: var(--member-text);
  font-weight: 500;
}

/* Simpanan Table */
.simpanan-table {
  background: var(--member-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow-x: auto;
}

.simpanan-table h3 {
  font-size: 20px;
  color: var(--member-text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.simpanan-table h3 i {
  width: 24px;
  height: 24px;
  color: var(--member-primary);
}

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

.simpanan-table th {
  background: var(--member-bg);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--member-text);
  font-size: 14px;
  border-bottom: 2px solid var(--member-border);
}

.simpanan-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--member-border);
  color: var(--member-text);
}

.simpanan-table tr:hover {
  background: var(--member-bg);
}

/* Chart Container */
.chart-container-member {
  background: var(--member-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.chart-container-member h3 {
  font-size: 20px;
  color: var(--member-text);
  margin-bottom: 20px;
}

/* Footer */
.member-footer {
  background: white;
  border-top: 1px solid var(--member-border);
  padding: 24px 0;
  text-align: center;
  color: var(--member-text-light);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 16px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .nav-container {
    padding: 0 16px;
  }
  
  .nav-item span {
    display: none;
  }
  
  .nav-item {
    padding: 16px;
  }
  
  .content-container {
    padding: 0 16px;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-meta {
    justify-content: center;
  }
  
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

/* Loading State */
.loading-member {
  text-align: center;
  padding: 60px 20px;
  color: var(--member-text-light);
}

.loading-member i {
  width: 48px;
  height: 48px;
  color: var(--member-primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--member-text-light);
}

.empty-state i {
  width: 64px;
  height: 64px;
  color: var(--member-border);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--member-text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
}


/* Upload Buttons for Camera */
.upload-buttons-container {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.upload-buttons-container .btn {
  flex: 1;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-buttons-container .btn-secondary {
  background: #f5f5f5;
  color: #333;
}

.upload-buttons-container .btn-secondary:hover {
  background: #e0e0e0;
}

.upload-buttons-container .btn-primary {
  background: linear-gradient(135deg, var(--member-primary), var(--member-secondary));
  color: white;
}

.upload-buttons-container .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.upload-buttons-container .btn i {
  width: 18px;
  height: 18px;
}

/* Mobile Optimization for Upload Buttons */
@media (max-width: 480px) {
  .upload-buttons-container {
    flex-direction: column;
  }
  
  .upload-buttons-container .btn {
    width: 100%;
    padding: 14px;
  }
}

/* Preview Image Enhancement */
#previewBuktiBayarMember img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  #previewBuktiBayarMember img {
    max-width: 100%;
    max-height: 300px;
  }
}


/* ===== CAMERA MODAL STYLES ===== */

#cameraModalMember .modal-content {
  animation: slideUp 0.3s ease-out;
}

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

#cameraVideoMember {
  background: #000;
  object-fit: cover;
}

#cameraErrorMember {
  display: flex;
  align-items: center;
  gap: 8px;
}

#cameraErrorMember i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Camera button styles */
.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-sm i {
  width: 16px;
  height: 16px;
}

.btn-sm.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-sm.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-sm.btn-info {
  background: #17a2b8;
  color: white;
}

.btn-sm.btn-info:hover {
  background: #138496;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Responsive camera modal */
@media (max-width: 768px) {
  #cameraModalMember .modal-content {
    max-width: 95% !important;
    margin: 10px;
  }
  
  #cameraVideoMember {
    max-height: 300px !important;
  }
  
  #cameraModalMember .btn {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  #cameraModalMember .btn i {
    width: 18px;
    height: 18px;
  }
}

/* Loading animation for camera */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.camera-loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===== DOWNLOAD STRUK BUTTON STYLES ===== */

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-sm.btn-success {
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  color: white;
}

.btn-sm.btn-success:hover {
  background: linear-gradient(135deg, #45a049, #1B5E20);
}

.btn-sm i {
  width: 14px;
  height: 14px;
}

/* Table action column */
.simpanan-table th:last-child,
.simpanan-table td:last-child {
  width: 80px;
  text-align: center;
}

/* Download button in table */
.simpanan-table .btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

.simpanan-table .btn-sm i {
  width: 12px;
  height: 12px;
}

/* Responsive download buttons */
@media (max-width: 768px) {
  .simpanan-table .btn-sm {
    padding: 6px;
    font-size: 10px;
  }
  
  .simpanan-table .btn-sm i {
    width: 14px;
    height: 14px;
  }
  
  .simpanan-table th:last-child,
  .simpanan-table td:last-child {
    width: 60px;
  }
}

@media (max-width: 480px) {
  .simpanan-table .btn-sm {
    padding: 4px;
  }
  
  .simpanan-table th:last-child,
  .simpanan-table td:last-child {
    width: 50px;
  }
}
/* Re
sponsive Design */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .logo-section {
    justify-content: center;
  }
  
  .logo-info h1 {
    font-size: 20px;
  }
  
  .logo-info p {
    font-size: 12px;
  }
  
  .header-actions {
    gap: 16px;
    justify-content: center;
  }
  
  .user-name {
    max-width: 120px;
    font-size: 14px;
  }
  
  .user-role {
    font-size: 12px;
  }
  
  .btn-logout {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  .member-nav {
    top: 140px;
  }
  
  .nav-container {
    padding: 0 16px;
  }
  
  .nav-item {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .content-container {
    padding: 0 16px;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .stat-value {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 16px;
  }
  
  .logo-image-container {
    width: 50px;
    height: 50px;
  }
  
  .logo-image-container img,
  .logo-circle {
    width: 50px;
    height: 50px;
  }
  
  .logo-info h1 {
    font-size: 18px;
  }
  
  .user-avatar {
    width: 40px;
    height: 40px;
  }
  
  .user-avatar i {
    width: 20px;
    height: 20px;
  }
  
  .user-name {
    max-width: 100px;
    font-size: 13px;
  }
  
  .btn-logout {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .btn-logout span {
    display: none;
  }
  
  .member-nav {
    top: 120px;
  }
  
  .nav-item {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .nav-item span {
    display: none;
  }
}