/* Nifty Framework Replacement - Bootstrap 5 Compatible */
/* This file provides direct replacements for common Nifty classes */

/* ======================================
   IMAGE SIZE CLASSES
   ====================================== */

/* Nifty: .img-xxlg (220x220) */
.img-xxlg {
  width: 220px;
  height: 220px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Nifty: .img-xlg (160x160) */
.img-xlg {
  width: 160px;
  height: 160px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Nifty: .img-lg (96x96) */
.img-lg {
  width: 96px;
  height: 96px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Nifty: .img-md (64x64) */
.img-md {
  width: 64px;
  height: 64px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Nifty: .img-sm (46x46) */
.img-sm {
  width: 46px;
  height: 46px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Nifty: .img-xs (32x32) */
.img-xs {
  width: 32px;
  height: 32px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ======================================
   LAYOUT CLASSES
   ====================================== */

/* Nifty: .boxed */
.boxed {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 24px;
  margin: 20px 0;
}

/* Nifty: .fixed-fluid layouts */
.fixed-fluid {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.fixed-fluid > .pull-xs-left,
.fixed-fluid > .pull-sm-left,
.fixed-fluid > .pull-md-left,
.fixed-fluid > .pull-lg-left {
  flex-shrink: 0;
}

.fixed-fluid > .pull-xs-right,
.fixed-fluid > .pull-sm-right,
.fixed-fluid > .pull-md-right,
.fixed-fluid > .pull-lg-right {
  flex-shrink: 0;
  margin-left: auto;
}

.fixed-fluid > .fluid {
  flex: 1;
  min-width: 0;
}

/* Fixed width classes */
.fixed-xs-160, .fixed-sm-160, .fixed-md-160, .fixed-lg-160 { width: 160px; }
.fixed-xs-200, .fixed-sm-200, .fixed-md-200, .fixed-lg-200 { width: 200px; }
.fixed-xs-250, .fixed-sm-250, .fixed-md-250, .fixed-lg-250 { width: 250px; }
.fixed-xs-300, .fixed-sm-300, .fixed-md-300, .fixed-lg-300 { width: 300px; }
.fixed-xs-350, .fixed-sm-350, .fixed-md-350, .fixed-lg-350 { width: 350px; }

/* ======================================
   PAGE HEADER
   ====================================== */

/* Nifty: #page-title */
#page-title {
  padding: 15px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  color: #2c3e50;
  font-weight: 600;
}

/* Nifty: .page-header */
.page-header {
  border: 0;
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  padding: 15px 0;
  color: #2c3e50;
}

.page-header .label {
  margin-right: 0.5rem;
}

/* ======================================
   MARGIN UTILITIES
   ====================================== */

/* Nifty: .mar-no */
.mar-no {
  margin: 0 !important;
}

/* Nifty: .mar-all */
.mar-all {
  margin: 15px;
}

/* Nifty: .mar-top */
.mar-top {
  margin-top: 15px;
}

/* Nifty: .mar-bottom */
.mar-bottom {
  margin-bottom: 15px;
}

/* Nifty: .mar-left */
.mar-left {
  margin-left: 15px;
}

/* Nifty: .mar-right */
.mar-right {
  margin-right: 15px;
}

/* ======================================
   PADDING UTILITIES
   ====================================== */

/* Nifty: .pad-all */
.pad-all {
  padding: 15px;
}

/* Nifty: .pad-top */
.pad-top {
  padding-top: 15px;
}

/* Nifty: .pad-bottom */
.pad-bottom {
  padding-bottom: 15px;
}

/* Nifty: .pad-left */
.pad-left {
  padding-left: 15px;
}

/* Nifty: .pad-right */
.pad-right {
  padding-right: 15px;
}

/* ======================================
   TEXT UTILITIES
   ====================================== */

/* Nifty: .text-main */
.text-main {
  color: #2c3e50;
}

/* Nifty: .text-primary */
.text-primary {
  color: #0F75BD;
}

/* Nifty: .text-success */
.text-success {
  color: #28a745;
}

/* Nifty: .text-info */
.text-info {
  color: #17a2b8;
}

/* Nifty: .text-warning */
.text-warning {
  color: #ffc107;
}

/* Nifty: .text-danger */
.text-danger {
  color: #dc3545;
}

/* Nifty: .text-muted */
.text-muted {
  color: #6c757d;
}

/* Nifty: .text-semibold */
.text-semibold {
  font-weight: 600;
}

/* Nifty: .text-lg */
.text-lg {
  font-size: 1.25rem;
  line-height: 1.4;
}

/* Nifty: .text-sm */
.text-sm {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ======================================
   PANELS AND CONTAINERS
   ====================================== */

/* Nifty: .panel */
.panel {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

/* Nifty: .panel-body */
.panel-body {
  padding: 20px;
}

/* Nifty: .panel-header */
.panel-header {
  padding: 15px 20px;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  font-weight: 600;
  color: #2c3e50;
}

/* Nifty: .panel-footer */
.panel-footer {
  padding: 15px 20px;
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
}

/* ======================================
   MEDIA BLOCKS
   ====================================== */

/* Nifty: .media-block */
.media-block {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 15px;
}

/* Nifty: .media-left */
.media-left {
  flex-shrink: 0;
}

/* Nifty: .media-body */
.media-body {
  flex: 1;
  min-width: 0;
}

/* Nifty: .media-right */
.media-right {
  flex-shrink: 0;
  margin-left: auto;
}

/* ======================================
   RESPONSIVE UTILITIES
   ====================================== */

/* Mobile specific styles */
@media (max-width: 767px) {
  .img-xxlg {
    width: 150px;
    height: 150px;
  }
  
  .img-xlg {
    width: 120px;
    height: 120px;
  }
  
  .boxed {
    padding: 16px;
    margin: 16px 0;
  }
  
  .fixed-fluid {
    flex-direction: column;
    gap: 10px;
  }
  
  .fixed-fluid > .pull-xs-right,
  .fixed-fluid > .pull-sm-right,
  .fixed-fluid > .pull-md-right,
  .fixed-fluid > .pull-lg-right {
    margin-left: 0;
  }
  
  .page-header {
    font-size: 1.5rem;
  }
  
  #page-title {
    padding: 12px 16px;
  }
}

/* ======================================
   PROFILE PICTURE SPECIFIC FIXES
   ====================================== */

/* Fix for profile pictures that might be loading slowly */
.profile-picture-container {
  position: relative;
  display: inline-block;
}

.profile-picture-container img {
  transition: opacity 0.3s ease;
}

.profile-picture-container img[src*="default_profile_picture"] {
  opacity: 0.8;
  background-color: #f8f9fa;
  border: 2px solid #dee2e6;
}

.profile-picture-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%, transparent 75%, #f8f9fa 75%, #f8f9fa),
              linear-gradient(45deg, #f8f9fa 25%, transparent 25%, transparent 75%, #f8f9fa 75%, #f8f9fa);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  opacity: 0.1;
  border-radius: inherit;
  pointer-events: none;
}

/* Loading state for images */
.img-loading {
  background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ======================================
   DARK MODE SUPPORT
   ====================================== */

@media (prefers-color-scheme: dark) {
  .boxed,
  .panel {
    background-color: #2c3e50;
    border-color: #495057;
  }
  
  .panel-header,
  .panel-footer,
  #page-title {
    background-color: #343a40;
    border-color: #495057;
  }
  
  .text-main,
  .page-header {
    color: #ffffff;
  }
  
  .text-muted {
    color: #adb5bd;
  }
  
  .profile-picture-container img[src*="default_profile_picture"] {
    background-color: #343a40;
    border-color: #495057;
  }
}