@import url("https://fonts.googleapis.com/css2?family=Open+Sans&family=Roboto:wght@300&family=Ubuntu+Mono&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&family=Tajawal:wght@400;500;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap");

/* Global Styles */
:root {
  --global-bg-color: #ffffff;
  --global-code-bg-color: rgba(181, 9, 172, 0.05);
  --global-text-color: #000000;
  --global-text-color-light: #828282;
  --global-theme-color: #002d72;
  --global-hover-color: #ffb81c;
  --global-footer-bg-color: #1c1c1c;
  --global-footer-text-color: #e8e8e8;
  --global-footer-link-color: #ffffff;
  --global-distill-app-color: #828282;
}

/* Language-specific fonts */
[lang="ar"] body,
[lang="ar"] {
  font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
}

[lang="zh"] body,
[lang="zh"] {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

[lang="en"] body,
[lang="en"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: #fff;
  padding: 50px;
  font:
    18px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Fira Sans",
    "Droid Sans",
    "Helvetica Neue",
    Arial,
    sans-serif,
    "Apple Color Emoji",
    "Segoe UI Emoji",
    "Segoe UI Symbol";
  color: #595959;
  font-weight: 400;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: #39c;
  margin: 0 0 20px;
}

h1 {
  font-weight: 500;
  color: #39c;
  margin: 0 0 20px;
}

h2 {
  color: #39c;
  font-weight: 500;
  margin: 2px 0px 15px;
  font-size: 157%;
}

p,
ul,
ol,
table,
pre,
dl {
  margin: 0 0 20px;
}

h1,
h2,
h3 {
  line-height: 1.1;
}

h1 {
  font-size: 28px;
}

a {
  color: #39c;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(0, 153, 204, 0.3);
  touch-action: manipulation;
}

a:hover {
  color: #069;
}

a:active {
  color: #069;
  opacity: 0.8;
}

a small {
  font-size: 11px;
  color: #777;
  margin-top: -0.3em;
  display: block;
}

a:hover small {
  color: #777;
}

.wrapper {
  width: 960px;
  margin: 0 auto;
}

blockquote {
  background: var(--global-bg-color);
  border-left: 2px solid var(--global-theme-color);
  margin: 1.5em 10px;
  padding: 0.5em 10px;
  font-size: 1.2rem;
}

code,
pre {
  font-family:
    Monaco,
    Bitstream Vera Sans Mono,
    Lucida Console,
    Terminal,
    Consolas,
    Liberation Mono,
    DejaVu Sans Mono,
    Courier New,
    monospace;
  color: #333;
}

pre {
  max-width: 100%;
  padding: 8px 15px;
  background: #f8f8f8;
  border-radius: 5px;
  border: 1px solid #e5e5e5;
  overflow-x: auto;
  word-wrap: break-word;
  white-space: pre-wrap;
}

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

th,
td {
  text-align: left;
  padding: 5px 10px;
  border-bottom: 1px solid #e5e5e5;
}

dt {
  color: #444;
  font-weight: 500;
}

th {
  color: #444;
}

img {
  max-width: 100%;
}

header {
  width: 232px;
  float: left;
  position: fixed;
  -webkit-font-smoothing: subpixel-antialiased;
  padding-top: 4em;
  text-align: center;
}

header ul {
  list-style: none;
  height: 40px;
  padding: 0;
  background: #f4f4f4;
  border-radius: 5px;
  border: 1px solid #e0e0e0;
  width: 270px;
}

header li {
  width: 89px;
  float: left;
  border-right: 1px solid #e0e0e0;
  height: 40px;
}

header li:first-child a {
  border-radius: 5px 0 0 5px;
}

header li:last-child a {
  border-radius: 0 5px 5px 0;
}

header ul a {
  line-height: 1;
  font-size: 11px;
  color: #999;
  display: block;
  text-align: center;
  padding-top: 6px;
  height: 34px;
}

header ul a:hover {
  color: #999;
}

header ul a:active {
  background-color: #f0f0f0;
}

strong {
  color: #222;
  font-weight: 500;
}

header ul li + li + li {
  border-right: none;
  width: 89px;
}

header ul a strong {
  font-size: 14px;
  display: block;
  color: #222;
}

section {
  width: 650px;
  float: right;
  padding-top: 4em;
  padding-bottom: 50px;
}

small {
  font-size: 11px;
}

hr {
  border: 0;
  background: #e5e5e5;
  height: 1px;
  margin: 0 0 20px;
}

footer {
  width: 232px;
  float: left;
  position: fixed;
  bottom: 30px;
  -webkit-font-smoothing: subpixel-antialiased;
  text-align: center;
}

.image {
  border-radius: 0.35em;
  border: 0;
  display: inline-block;
  position: relative;
}

.image:before {
  -moz-transition: opacity 0.2s ease-in-out;
  -webkit-transition: opacity 0.2s ease-in-out;
  -ms-transition: opacity 0.2s ease-in-out;
  transition: opacity 0.2s ease-in-out;
  border-radius: 0.35em;
  content: "";
  display: block;
  height: 100%;
  left: 0;
  opacity: 0.5;
  position: absolute;
  top: 0;
  width: 100%;
}

.image.avatar {
  border-radius: 100%;
}

.image.avatar:before {
  display: none;
}

.image.avatar img {
  border-radius: 25%;
  width: 180px;
  padding: 20px;
}

#header .image.avatar {
  margin: 0 0 1em 0;
  width: 8em;
}

.social-icons a {
  display: inline-block;
  height: 2.4rem;
  width: 2.4rem;
  background-color: transparent;
  color: #39c !important;
  border-radius: 100%;
  text-align: center;
  font-size: 1.15rem;
  line-height: 2.5rem;
  margin-right: 1rem;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: rgba(0, 153, 204, 0.3);
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
}

.social-icons a:last-child {
  margin-right: 0;
}

.social-icons a:hover,
.social-icons a:active {
  background-color: #f0f0f0;
  color: #069 !important;
  transform: scale(1.1);
}

email {
  font-size: 16px;
  font-family: "Ubuntu Mono";
}

education {
  font-weight: 500;
  font-size: 115%;
}

/* Publications */
.publications {
  margin-top: 2rem;
}

.publications h1 {
  color: var(--global-theme-color);
  font-size: 2rem;
  text-align: center;
  margin-top: 1em;
  margin-bottom: 1em;
}

.publications h2 {
  margin-bottom: 1rem;
}

.publications h2 span {
  font-size: 1.5rem;
}

.publications h2.year {
  color: #e8e8e8;
  border-top: 1px solid #e8e8e8;
  margin-top: 2rem;
  margin-bottom: 0rem;
  text-align: right;
}

.publications ol.bibliography {
  list-style: none;
  padding: 0;
  margin-top: 0;
}

.publications ol.bibliography li {
  min-height: 110px;
  margin-bottom: 0.5rem;
}

.publications ol.bibliography li .abbr {
  height: 8rem;
  margin-bottom: 0.5rem;
}

.publications ol.bibliography li .abbr abbr {
  display: inline-block;
  background-color: var(--global-theme-color);
  padding-left: 1rem;
  padding-right: 1rem;
  position: absolute;
  top: 8px;
  left: 16px;
}

.publications ol.bibliography li .abbr abbr a {
  color: white;
}

.publications ol.bibliography li .abbr abbr a:hover {
  text-decoration: none;
}

.publications ol.bibliography li .abbr .award {
  color: var(--global-theme-color) !important;
  border: 1px solid var(--global-theme-color);
}

.publications ol.bibliography li .title {
  font-weight: 600;
  color: #000000;
}

.publications ol.bibliography li .author a {
  border-bottom: 1px var(--global-theme-color);
}

.publications ol.bibliography li .author a:hover {
  border-bottom-style: solid;
  text-decoration: none;
}

.publications ol.bibliography li .author > em {
  border-bottom: 1px solid;
  font-style: normal;
}

.publications ol.bibliography li .links a.btn {
  color: #000000;
  border: 1px solid #000000;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
}

.publications ol.bibliography li .links a.btn:hover {
  color: var(--global-theme-color);
  border-color: var(--global-theme-color);
}

.pub-row {
  display: flex;
  align-items: center;
}

@media print, screen and (min-width: 480px) {
  .col-sm-9 {
    width: 100%;
  }
}

/* Responsive Design */
@media print, screen and (max-width: 960px) {
  .pub-row {
    display: flex;
    align-items: center;
  }
  div.wrapper {
    width: auto;
    margin: 0;
  }
  header,
  section,
  footer {
    float: none;
    position: static;
    width: auto;
  }
  header {
    padding-right: 0;
    text-align: center;
    padding-top: 2em;
  }
  section {
    border: 1px solid #e5e5e5;
    border-width: 1px 0;
    padding: 20px 15px;
    margin: 0 0 20px;
  }
  header a small {
    display: inline;
  }
  header ul {
    position: relative;
    right: auto;
    top: auto;
    margin: 20px auto;
  }
  .image.avatar img {
    border-radius: 25%;
    width: 150px;
    padding: 15px;
  }
}

@media print, screen and (max-width: 720px) {
  body {
    word-wrap: break-word;
    padding: 10px;
  }
  .pub-row {
    display: flex;
    align-items: center;
  }
  header {
    padding: 0;
    padding-top: 1em;
  }
  section {
    padding: 15px 10px;
  }
  pre,
  code {
    word-wrap: normal;
    font-size: 14px;
  }
  h1 {
    font-size: 24px;
  }
  h2 {
    font-size: 140%;
  }
  h3 {
    font-size: 120%;
  }
  p, li {
    font-size: 16px;
    line-height: 1.6;
  }
  .image.avatar img {
    width: 120px;
    padding: 10px;
  }
  .social-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .social-icons a {
    height: 2rem;
    width: 2rem;
    font-size: 1rem;
    line-height: 2rem;
    margin-right: 0.5rem;
  }
  email {
    font-size: 14px;
  }
  .wrapper {
    max-width: 100%;
  }
}

/* أجهزة لوحية أفقية */
@media print, screen and (min-width: 481px) and (max-width: 720px) {
  body {
    padding: 20px;
  }
  section {
    padding: 20px 15px;
  }
  .image.avatar img {
    width: 140px;
  }
  h1 {
    font-size: 26px;
  }
  p, li {
    font-size: 17px;
  }
}

@media print, screen and (max-width: 480px) {
  .pub-row {
    display: block;
    align-items: center;
  }
  body {
    padding: 8px;
  }
  header {
    padding: 0;
    padding-top: 0.5em;
  }
  section {
    padding: 10px 5px;
  }
  header ul {
    width: 99%;
  }
  header li,
  header ul li + li + li {
    width: 33%;
  }
  .image.avatar img {
    border-radius: 25%;
    width: 100px;
    padding: 8px;
  }
  h1 {
    font-size: 20px;
  }
  h3 {
    font-size: 110%;
    margin-bottom: 15px;
  }
  p, li {
    font-size: 15px;
    line-height: 1.5;
  }
  .social-icons a {
    height: 2.2rem;
    width: 2.2rem;
    font-size: 1rem;
    line-height: 2.2rem;
    margin-right: 0.5rem;
    min-width: 44px;
    min-height: 44px;
  }
  email {
    font-size: 13px;
    word-break: break-word;
  }
  education {
    font-size: 105%;
  }
  .wrapper {
    max-width: 100%;
    overflow-x: hidden;
  }
  strong {
    word-break: break-word;
  }
  .publications ol.bibliography li {
    min-height: auto;
    margin-bottom: 1rem;
  }
  .publications ol.bibliography li .title {
    font-size: 16px;
  }
  .publications ol.bibliography li .author {
    font-size: 14px;
  }
  .publications ol.bibliography li .adoption {
    font-size: 14px;
  }
  
  /* تحسينات إضافية للجوالات */
  div[style*="padding-left: 20px"] {
    padding-left: 10px !important;
    padding-right: 5px !important;
  }
  
  br {
    line-height: 1.2;
  }
  
  /* تحسين القراءة */
  body {
    text-rendering: optimizeLegibility;
  }
  
  /* منع التكبير غير المرغوب */
  input, select, textarea {
    font-size: 16px !important;
  }
  
  /* تحسين الأزرار والروابط للمس */
  a, button {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* تحسين النصوص الطويلة */
  p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

@media print {
  body {
    padding: 0.4in;
    font-size: 12pt;
    color: #444;
  }
}

/* RTL Support for Arabic */
[lang="ar"] {
  direction: rtl;
  text-align: right;
}

[lang="ar"] header {
  float: right;
}

[lang="ar"] section {
  float: left;
}

[lang="ar"] footer {
  float: right;
}

[lang="ar"] .social-icons {
  direction: ltr;
}

[lang="ar"] [style*="padding-left: 20px"] {
  padding-left: 0 !important;
  padding-right: 20px !important;
}

[lang="ar"] [style*="padding-right: 10px"] {
  padding-right: 0 !important;
  padding-left: 10px !important;
}

/* Chinese font optimization */
[lang="zh"] body {
  letter-spacing: 0.02em;
}

[lang="zh"] h1, [lang="zh"] h2, [lang="zh"] h3 {
  letter-spacing: 0.05em;
}

/* Responsive RTL fixes */
@media print, screen and (max-width: 960px) {
  [lang="ar"] header,
  [lang="ar"] section,
  [lang="ar"] footer {
    float: none;
  }
}

