/**
 * Minh Tri Core Main Styles
 * 
 * @package MinhTriCore
 * @since 1.0.0
 */

/* ======================================
   Global Styles
   ====================================== */

.minh-tri-core {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ======================================
   Utilities
   ====================================== */

.mtc-clearfix::after {
  content: "";
  display: table;
  clear: both;
}

.mtc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.mtc-text-left {
  text-align: left;
}

.mtc-text-right {
  text-align: right;
}

.mtc-hidden {
  display: none !important;
}

.mtc-visible {
  display: block !important;
}

/* ======================================
   Common Components
   ====================================== */

.mtc-button {
  display: inline-block;
  padding: 12px 24px;
  background: #007cba;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.mtc-button:hover {
  background: #005a87;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

.mtc-button:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

.mtc-button.secondary {
  background: #6c757d;
}

.mtc-button.secondary:hover {
  background: #5a6268;
}

.mtc-button.success {
  background: #28a745;
}

.mtc-button.success:hover {
  background: #218838;
}

.mtc-button.danger {
  background: #dc3545;
}

.mtc-button.danger:hover {
  background: #c82333;
}

.mtc-button.outline {
  background: transparent;
  color: #007cba;
  border: 2px solid #007cba;
}

.mtc-button.outline:hover {
  background: #007cba;
  color: white;
}

.mtc-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ======================================
   Grid System
   ====================================== */

.mtc-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.mtc-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.mtc-col {
  flex: 1;
  padding: 0 15px;
}

.mtc-col-1 {
  flex: 0 0 8.333333%;
  max-width: 8.333333%;
}
.mtc-col-2 {
  flex: 0 0 16.666667%;
  max-width: 16.666667%;
}
.mtc-col-3 {
  flex: 0 0 25%;
  max-width: 25%;
}
.mtc-col-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}
.mtc-col-5 {
  flex: 0 0 41.666667%;
  max-width: 41.666667%;
}
.mtc-col-6 {
  flex: 0 0 50%;
  max-width: 50%;
}
.mtc-col-7 {
  flex: 0 0 58.333333%;
  max-width: 58.333333%;
}
.mtc-col-8 {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
}
.mtc-col-9 {
  flex: 0 0 75%;
  max-width: 75%;
}
.mtc-col-10 {
  flex: 0 0 83.333333%;
  max-width: 83.333333%;
}
.mtc-col-11 {
  flex: 0 0 91.666667%;
  max-width: 91.666667%;
}
.mtc-col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

@media (max-width: 768px) {
  .mtc-col-1,
  .mtc-col-2,
  .mtc-col-3,
  .mtc-col-4,
  .mtc-col-5,
  .mtc-col-6,
  .mtc-col-7,
  .mtc-col-8,
  .mtc-col-9,
  .mtc-col-10,
  .mtc-col-11,
  .mtc-col-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ======================================
   Cards
   ====================================== */

.mtc-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.mtc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.mtc-card-header {
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.mtc-card-body {
  padding: 20px;
}

.mtc-card-footer {
  padding: 20px;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
}

.mtc-card-title {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

.mtc-card-text {
  color: #666;
  line-height: 1.6;
}

/* ======================================
   Loading States
   ====================================== */

.mtc-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007cba;
  border-radius: 50%;
  animation: mtc-spin 1s linear infinite;
}

@keyframes mtc-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.mtc-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.mtc-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007cba;
  border-radius: 50%;
  animation: mtc-spin 1s linear infinite;
}

/* ======================================
   Notifications
   ====================================== */

.mtc-notice {
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 4px;
  border-left: 4px solid;
}

.mtc-notice.success {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.mtc-notice.error {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.mtc-notice.warning {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.mtc-notice.info {
  background: #d1ecf1;
  border-color: #17a2b8;
  color: #0c5460;
}

/* ======================================
   Forms
   ====================================== */

.mtc-form-group {
  margin-bottom: 20px;
}

.mtc-form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #333;
}

.mtc-form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.mtc-form-control:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.mtc-form-control:disabled {
  background: #f8f9fa;
  cursor: not-allowed;
}

.mtc-form-text {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

.mtc-checkbox,
.mtc-radio {
  margin-right: 8px;
}

/* ======================================
   Tables
   ====================================== */

.mtc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.mtc-table th,
.mtc-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.mtc-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
}

.mtc-table tbody tr:hover {
  background: #f8f9fa;
}

.mtc-table.striped tbody tr:nth-child(even) {
  background: #f8f9fa;
}

/* ======================================
   Modal
   ====================================== */

.mtc-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.mtc-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mtc-modal-content {
  background-color: white;
  border-radius: 8px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.mtc-modal-header {
  padding: 20px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mtc-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.mtc-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.mtc-modal-close:hover {
  background: #f8f9fa;
}

.mtc-modal-body {
  padding: 20px;
}

.mtc-modal-footer {
  padding: 20px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ======================================
   Responsive Design
   ====================================== */

@media (max-width: 768px) {
  .mtc-container {
    padding: 0 15px;
  }

  .mtc-row {
    margin: 0 -10px;
  }

  .mtc-col {
    padding: 0 10px;
  }

  .mtc-card-header,
  .mtc-card-body,
  .mtc-card-footer {
    padding: 15px;
  }

  .mtc-modal-content {
    width: 95%;
  }

  .mtc-modal-header,
  .mtc-modal-body,
  .mtc-modal-footer {
    padding: 15px;
  }

  .mtc-table {
    font-size: 14px;
  }

  .mtc-table th,
  .mtc-table td {
    padding: 8px 10px;
  }
}

/* ======================================
   Print Styles
   ====================================== */

@media print {
  .mtc-button,
  .mtc-modal,
  .mtc-loading-overlay {
    display: none !important;
  }

  .mtc-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .mtc-notice {
    border: 1px solid;
  }
}
