/* Laws Module Styles */
.laws-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  /* Premium Image Background */
  background: url('assets/qudrat_laws_bg.jpg') center/cover no-repeat fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Glassmorphism Dark Tint over the image */
.laws-modal-overlay::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.65); /* Elegant Dark Tint */
  backdrop-filter: blur(8px);
  z-index: -1;
}

.laws-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.laws-header {
  padding: 1.2rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
  z-index: 10;
}

.laws-header-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.laws-header-title i {
  font-size: 1.8rem;
  color: var(--brand-primary);
  background: var(--grad-emerald);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.laws-header-title h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
}

.laws-close-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.laws-close-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  transform: rotate(90deg);
}

.laws-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.laws-sidebar {
  width: 320px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: -4px 0 20px rgba(0,0,0,0.05);
}

.laws-search-box {
  position: relative;
  margin-bottom: 1rem;
}

.laws-search-box i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.laws-search-box input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.8rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.laws-search-box input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
  outline: none;
}

.laws-category-btn {
  background: transparent;
  border: 1px solid transparent;
  text-align: right;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
  font-size: 1rem;
}

.laws-category-btn:hover {
  background: rgba(13, 148, 136, 0.05);
  color: var(--brand-primary);
  border-color: rgba(13, 148, 136, 0.1);
}

.laws-category-btn.active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.laws-category-count {
  background: rgba(0,0,0,0.08);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 800;
}
.laws-category-btn.active .laws-category-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.laws-content {
  flex: 1;
  padding: 2.5rem;
  overflow-y: auto;
  /* Custom scrollbar for content */
}
.laws-content::-webkit-scrollbar {
  width: 8px;
}
.laws-content::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

.laws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1.8rem;
  align-items: start; /* Prevents vertical stretching and masonry overlap! */
}

.law-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.law-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.25);
  border-color: var(--brand-primary);
}

.law-card-header {
  padding: 1.4rem 1.8rem;
  background: rgba(13, 148, 136, 0.04);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.law-card-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(13, 148, 136, 0.2);
}

.law-card-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  line-height: 1.5;
}

.law-card-body {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  flex: 1;
}

.law-formula-box {
  background: var(--bg-primary);
  border: 2px dashed var(--brand-primary);
  border-radius: 14px;
  padding: 1.2rem;
  text-align: center;
  font-weight: 800;
  color: var(--brand-primary);
  font-size: 1.15rem;
  line-height: 1.6;
}

.law-explanation {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.law-example-box {
  background: rgba(16, 185, 129, 0.05);
  border-right: 4px solid #10b981;
  border-radius: 10px;
  padding: 1.2rem;
}

.law-example-q {
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.8rem;
  font-size: 1rem;
  line-height: 1.5;
}

.law-example-a {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.6;
}

.law-tip-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-size: 0.9rem;
  color: #d97706;
  background: rgba(245, 158, 11, 0.08);
  padding: 1rem;
  border-radius: 10px;
  font-weight: 600;
  line-height: 1.5;
}
.law-tip-box i {
  margin-top: 3px;
  font-size: 1.1rem;
}

.law-calc-box {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 1.2rem;
  border: 1px solid var(--border-color);
  margin-top: auto; /* Push to bottom if flex */
}
.law-calc-header {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.law-calc-inputs {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.law-calc-inputs input {
  flex: 1;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  width: 100%;
}
.law-calc-inputs input:focus {
  border-color: var(--brand-primary);
  outline: none;
}
.law-calc-btn {
  width: 100%;
  padding: 0.8rem;
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 1rem;
  transition: 0.2s;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2);
}
.law-calc-btn:hover {
  background: #0f766e;
  transform: translateY(-2px);
}
.law-calc-result {
  margin-top: 1rem;
  font-weight: 800;
  text-align: center;
  color: #10b981;
  font-size: 1.1rem;
}

@media (max-width: 991px) {
  .laws-body {
    flex-direction: column;
  }
  .laws-sidebar {
    width: 100%;
    border-left: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    max-height: 250px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  }
  .laws-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .laws-content {
    padding: 1rem;
  }
}
