﻿/* Custom Modal Styles */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.custom-modal-dialog {
  position: relative;
  z-index: 10000;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  margin: 0 auto;
}

.custom-modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.custom-modal-header {
  background: linear-gradient(135deg, #052b42, #0164a7);;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

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

.custom-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.custom-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.custom-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* News Content Styles */
.news-modal-content {
  color: #333;
}

.news-modal-content .news-title {
  color: #1a1a2e;
  font-weight: 600;
}

.news-modal-content .news-description {
  font-size: 1.1rem;
  color: #666;
  font-style: italic;
  border-left: 3px solid #4986b1;
  padding-left: 1rem;
  background: rgba(73, 134, 177, 0.1);
  padding: 1rem;
  border-radius: 0 8px 8px 0;
}

.news-modal-content .news-content {
  line-height: 1.6;
  color: #555;
}

.news-modal-content .news-content p {
  margin-bottom: 1rem;
}

.news-modal-content .news-image img {
  max-height: 300px;
  object-fit: cover;
  width: 100%;
}

.news-meta .badge {
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
}

.news-modal-trigger {
  cursor: pointer;
  text-decoration: none;
}

.news-modal-trigger:hover {
  text-decoration: none;
}

/* Custom Scrollbar */
.custom-modal-body::-webkit-scrollbar {
  width: 6px;
}

.custom-modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.custom-modal-body::-webkit-scrollbar-thumb {
  background: #4986b1;
  border-radius: 3px;
}

.custom-modal-body::-webkit-scrollbar-thumb:hover {
  background: #2dd4bf;
}

/* RTL Support for Modal */
[dir="rtl"] .modal-header-rtl {
  flex-direction: row-reverse;
}

[dir="rtl"] .modal-header-rtl h3 {
  text-align: right;
}

[dir="rtl"] .modal-meta-rtl span:first-child {
  margin-left: 10px;
  margin-right: 0;
}

[dir="rtl"] .modal-description-rtl {
  border-left: none;
  border-right: 4px solid #007bff;
  padding-left: 15px;
  padding-right: 15px;
}

[dir="rtl"] .modal-content-rtl {
  text-align: right;
  direction: rtl;
  unicode-bidi: embed;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.8;
  font-size: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

[dir="rtl"] .modal-content-rtl p {
  text-align: right;
  direction: rtl;
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

[dir="rtl"] .modal-content-rtl h1,
[dir="rtl"] .modal-content-rtl h2,
[dir="rtl"] .modal-content-rtl h3,
[dir="rtl"] .modal-content-rtl h4,
[dir="rtl"] .modal-content-rtl h5,
[dir="rtl"] .modal-content-rtl h6 {
  text-align: right;
  direction: rtl;
  margin-bottom: 10px;
}

[dir="rtl"] .modal-content-rtl ul,
[dir="rtl"] .modal-content-rtl ol {
  text-align: right;
  direction: rtl;
  padding-right: 20px;
  padding-left: 0;
  margin-bottom: 15px;
}

[dir="rtl"] .modal-content-rtl li {
  text-align: right;
  direction: rtl;
  margin-bottom: 5px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

[dir="rtl"] .modal-content-rtl img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
}

[dir="rtl"] .modal-content-rtl blockquote {
  text-align: right;
  direction: rtl;
  border-right: 3px solid #007bff;
  border-left: none;
  padding-right: 15px;
  padding-left: 0;
  margin: 15px 0;
  font-style: italic;
}

[dir="rtl"] .modal-content-rtl a {
  color: #007bff;
  text-decoration: underline;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: inline-block;
  max-width: 100%;
}

[dir="rtl"] .modal-content-rtl a:hover {
  color: #0056b3;
  text-decoration: none;
}

[dir="rtl"] .modal-footer-rtl {
  text-align: left;
}

[dir="rtl"] .modal-dialog-rtl {
  direction: rtl;
}

/* LTR Support */
[dir="ltr"] .modal-header-rtl {
  flex-direction: row;
}

[dir="ltr"] .modal-header-rtl h3 {
  text-align: left;
}

[dir="ltr"] .modal-meta-rtl span:first-child {
  margin-right: 10px;
  margin-left: 0;
}

[dir="ltr"] .modal-description-rtl {
  border-right: none;
  border-left: 4px solid #007bff;
  padding-right: 15px;
  padding-left: 15px;
}

[dir="ltr"] .modal-content-rtl {
  text-align: left;
  direction: ltr;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

[dir="ltr"] .modal-content-rtl p {
  text-align: left;
  direction: ltr;
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

[dir="ltr"] .modal-content-rtl h1,
[dir="ltr"] .modal-content-rtl h2,
[dir="ltr"] .modal-content-rtl h3,
[dir="ltr"] .modal-content-rtl h4,
[dir="ltr"] .modal-content-rtl h5,
[dir="ltr"] .modal-content-rtl h6 {
  text-align: left;
  direction: ltr;
  margin-bottom: 10px;
}

[dir="ltr"] .modal-content-rtl ul,
[dir="ltr"] .modal-content-rtl ol {
  text-align: left;
  direction: ltr;
  padding-left: 20px;
  padding-right: 0;
  margin-bottom: 15px;
}

[dir="ltr"] .modal-content-rtl li {
  text-align: left;
  direction: ltr;
  margin-bottom: 5px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

[dir="ltr"] .modal-content-rtl img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
}

[dir="ltr"] .modal-content-rtl blockquote {
  text-align: left;
  direction: ltr;
  border-left: 3px solid #007bff;
  border-right: none;
  padding-left: 15px;
  padding-right: 0;
  margin: 15px 0;
  font-style: italic;
}

[dir="ltr"] .modal-footer-rtl {
  text-align: right;
}

[dir="ltr"] .modal-dialog-rtl {
  direction: ltr;
}

/* RTL Support for News Grid */
[dir="rtl"] #projects {
  direction: rtl;
}

[dir="rtl"] #projects .row {
  direction: rtl;
}

[dir="rtl"] #projects .project {
  text-align: right;
}

[dir="rtl"] #projects .portfolio-item-content {
  text-align: right;
}

[dir="rtl"] #projects .portfolio-item-content h3 {
  text-align: right;
}

[dir="rtl"] #projects .portfolio-item-content p {
  text-align: right;
}

/* LTR Support for News Grid */
[dir="ltr"] #projects {
  direction: ltr;
}

[dir="ltr"] #projects .row {
  direction: ltr;
}

[dir="ltr"] #projects .project {
  text-align: left;
}

[dir="ltr"] #projects .portfolio-item-content {
  text-align: left;
}

[dir="ltr"] #projects .portfolio-item-content h3 {
  text-align: left;
}

[dir="ltr"] #projects .portfolio-item-content p {
  text-align: left;
}

/* Home activity modal layer */
.news-modal-backdrop-layer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
}

.news-modal-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.news-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #040404;
  color: black;
  padding-bottom: 10px;
}

.news-modal-header h3 {
  margin: 0;
}

.news-modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.news-modal-image {
  width: 100%;
  height: 200px;
  background: #f0f0f0;
  margin-bottom: 15px;
  border-radius: 5px;
  object-fit: cover;
}

.news-modal-meta {
  margin-bottom: 15px;
}

.news-modal-date {
  background: #007bff;
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
}

.news-modal-category {
  background: #6c757d;
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  margin-left: 10px;
}

.news-modal-title {
  margin-bottom: 15px;
  color: #333;
}

.news-modal-body {
  line-height: 1.6;
  color: #555;
}

.news-modal-footer {
  margin-top: 20px;
  text-align: right;
}

.news-modal-close-action {
  background: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}
