@import url('style/button.css');

@font-face {
  font-family: "MyArabicFont";
  src: url("assets/font/ar_font.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MyEnglishFont";
  src: url("assets/font/en_font.otf") format("OpenType");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}


:root {
  --bg: #0f1020;
  --card: #0f1724;
  --accent1: linear-gradient(135deg, #7bffcc, #66d9ff);
  --accent2: linear-gradient(135deg, #ffb3ff, #ffdf7a);
  --glass: rgba(255, 255, 255, 0.04);
  --bidi-gap: 10px;
  --bidi-font-size: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  color: #e6eef8;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(102, 217, 255, 0.06), transparent),
    radial-gradient(1000px 400px at 90% 90%, rgba(255, 179, 255, 0.04), transparent),
    var(--bg);
  overflow-x: hidden;
}

.lang-en,
:lang(en) {
  font-family: "MyEnglishFont",
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  letter-spacing: 0.02em;
}

.lang-ar {
  font-size: 1.8em;
  line-height: 1.4;
}


.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
}

.subtitle {
  margin: 0;
  font-size: 12px;
  color: rgba(230, 238, 248, 0.7);
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.55)
  );
  background-size: 300% 300%;
  backdrop-filter: blur(32px);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 2px rgba(255, 255, 255, 0.65);
  transform: rotate(-6deg);
  cursor: pointer;
  user-select: none;
  animation: logoFrost 14s ease-in-out infinite, logoIdle 5.5s ease-in-out infinite;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.logo:hover {
  transform: translateY(-6px) rotate(-4deg);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 2px rgba(255, 255, 255, 0.7);
}

.logo:active {
  transform: translateY(-2px) rotate(-6deg) scale(0.96);
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.6),
    0 6px 18px rgba(0, 0, 0, 0.7);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

input[type=search] {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: inherit;
  min-width: 180px;
}

.btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 0;
  background: var(--glass);
  cursor: pointer;
}

select {
  padding: 8px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: inherit;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 28px;
  flex: 1 0 auto;
}

.summary {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  flex: 1;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.summary-card h3 {
  margin: 0 0 8px;
}

.summary-card p {
  margin: 0;
  font-size: 18px;
}

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 380px));
  gap: 16px;
  perspective: 1600px;
  justify-content: center;
  justify-items: stretch;
}

.projects[data-view=list] {
  grid-template-columns: 1fr;
}

.projects[data-view=list] .project-card {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 88px;
  transform: translateY(0);
}

.projects[data-view=list] .project-card:hover {
  transform: translateY(-4px);
}

.project-card {
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
  min-height: 120px;
  cursor: pointer;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  transition:
    transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.2, 0.9, 0.3, 1),
    border-color 0.23s ease,
    background 0.23s ease;
}

.project-card:hover {
  transform: translateY(-5%) rotateX(18deg) rotateZ(-0.5deg);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.75);
  border-color: rgba(255, 255, 255, 0.08);
}

.project-card:active {
  transform: translateY(-2px) scale(0.97);
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.7),
    0 6px 18px rgba(0, 0, 0, 0.7);
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.08;
  background: conic-gradient(
    from 120deg at 20% 30%,
    #7bffcc,
    #66d9ff,
    #ffb3ff,
    #ffdf7a,
    #7bffcc
  );
  transform: scale(1.3);
  filter: blur(32px);
  transition: opacity 0.4s;
}

.project-card:hover::after {
  opacity: 0.18;
}

.project-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.project-meta {
  font-size: 12px;
  color: rgba(230, 238, 248, 0.7);
}

.project-thumb {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff2 10%, #0002);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.project-logo-wrap {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.project-logo {
  max-width: 70%;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  transition: transform 0.4s ease, filter 0.4s ease;
  transform-origin: center bottom;
}

.project-characters {
  position: relative;
  margin-top: 6px;
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.character {
  position: absolute;
  bottom: 0;
  width: 64px;
  height: auto;
  opacity: 0;
  transform-origin: bottom center;
  transform: translateY(20px) scale(0.85);
  transition:
    transform 0.45s cubic-bezier(0.24, 0.82, 0.34, 1.15),
    opacity 0.45s ease;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6));
}

.character-left {
  left: 50%;
  transform: translateX(-130%) translateY(20px) scale(0.8) rotateZ(-8deg);
}

.character-front {
  left: 50%;
  transform: translateX(-50%) translateY(30px) scale(0.9);
}

.character-right {
  left: 50%;
  transform: translateX(30%) translateY(20px) scale(0.8) rotateZ(8deg);
}

.project-card:hover .project-logo {
  transform: translateY(-4px) translateZ(30px);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.75));
}

.project-card:hover .character-left {
  opacity: 1;
  transform: translateX(-135%) translateY(-6px) scale(0.9) rotateZ(-14deg)
    translateZ(40px);
}

.project-card:hover .character-front {
  opacity: 1;
  transform: translateX(-50%) translateY(-20px) scale(1) translateZ(80px);
}

.project-card:hover .character-right {
  opacity: 1;
  transform: translateX(35%) translateY(-6px) scale(0.9) rotateZ(14deg)
    translateZ(40px);
}

@keyframes pulseAnim {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0);
  }
}

.pulse {
  animation: pulseAnim 3s ease-in-out infinite;
}

@keyframes floaty {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}

.float {
  animation: floaty 4.2s ease-in-out infinite;
}

.glow {
  box-shadow:
    0 12px 40px rgba(123, 255, 204, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
  z-index: 1200;
  padding: 24px;
}

.modal-overlay.show {
  display: flex;
}

.modal-window {
  width: min(92vw, 920px);
  max-width: 900px;
  max-height: 90vh;
  height: min(90vh, 700px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  box-shadow: 0 28px 90px rgba(2, 6, 23, 0.75);
  position: relative;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.center {
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font-size: 16px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
  transition: transform 0.15s ease, background 0.15s ease;
}

.modal-close:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.12);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.modal-header h2 {
  margin: 0;
}

.modal-meta {
  font-size: 13px;
  color: rgba(230, 238, 248, 0.7);
}

.modal-body {
  padding-bottom: 14px;
  line-height: 1.5;
  color: rgba(230, 238, 248, 0.9);
}

#modalBody {
  flex: 1;
  overflow: auto;
}

body.modal-open {
  overflow: hidden;
}

.circle-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: 12px;
}

.circle-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s, background 0.18s, color 0.18s;
}

.circle-btn[aria-pressed=true] {
  transform: translateY(-4px);
  background: linear-gradient(135deg, #7bffcc, #66d9ff);
  color: #042;
}

.circle-btn:hover {
  transform: translateY(-3px);
}

.project-head .right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.lang-btn {
  width: 56px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 223, 122, 0.1);
  color: #d2c9ac;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.18s,
    background 0.18s,
    color 0.18s,
    box-shadow 0.18s;
}

.lang-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.lang-btn-active {
  background: var(--accent2);
  color: #042;
}

.lang-ar,
:lang(ar) {
  font-family: "MyArabicFont", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
  line-height: 1.6;
  letter-spacing: 0;
  font-size: 16px;
}

.bidi-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--bidi-gap);
  font-size: var(--bidi-font-size);
}

.bidi-line .lang-en {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  white-space: nowrap;
}

.bidi-line .lang-ar {
  direction: rtl;
  unicode-bidi: isolate;
  text-align: right;
  white-space: nowrap;
}

.subtitle.bidi-line {
  font-size: 12px;
  color: rgba(230, 238, 248, 0.7);
}

button:focus,
.circle-btn:focus,
.fab-main:focus,
.card-menu button:focus,
.btn:focus,
.lang-btn:focus {
  outline: 3px solid rgba(123, 255, 204, 0.12);
  outline-offset: 3px;
}

footer {
  position: static;
  margin-top: auto;
  padding: 14px 20px;
  font-size: 0.8rem;
  color: rgba(230, 238, 248, 0.65);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: radial-gradient(
      800px 200px at 50% 0,
      rgba(255, 255, 255, 0.03),
      transparent
    );
}

@media (max-width: 900px) {
  body {
    padding: 12px;
  }

  .topbar {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .controls > * {
    flex: 1;
  }

  input[type=search] {
    min-width: 0;
    width: 100%;
  }

  .container {
    padding: 18px 16px;
  }

  .summary {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  body {
    padding: 10px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 8px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .subtitle {
    font-size: 11px;
  }

  .controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  input[type=search],
  select,
  .btn {
    width: 100%;
  }

  .container {
    padding: 16px 12px;
  }

  .summary {
    gap: 10px;
    margin-bottom: 14px;
  }

  .summary-card p {
    font-size: 16px;
  }

  .projects {
    grid-template-columns: 1fr;
  }

  .projects[data-view=list] .project-card {
    flex-direction: row;
    align-items: flex-start;
  }

  .project-card {
    min-height: 0;
  }

  .project-thumb {
    width: 56px;
    height: 56px;
  }

  .project-characters {
    height: 70px;
  }

  .lang-en,
  .lang-ar {
    font-size: 1.4em;
  }

  .bidi-line {
    flex-direction: column;
    align-items: flex-start;
  }

  .bidi-line .lang-ar {
    align-self: flex-end;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .circle-filters {
    flex-direction: row;
    margin-top: 8px;
    margin-left: 0;
  }

  .circle-row {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .modal-overlay {
    padding: 0;
  }

  .modal-window {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    padding: 14px;
  }

  .lang-btn {
    width: auto;
    min-width: 44px;
    height: 30px;
    font-size: 0.75rem;
    padding: 4px 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  }
}

.project-bio a,
.bio-link {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  opacity: 0.9;
  transition: opacity 0.15s ease, text-decoration-color 0.15s ease;
}

.project-bio a:hover,
.bio-link:hover {
  opacity: 1;
  text-decoration-color: rgba(255, 255, 255, 0.9);
}

.project-bio a:active,
.bio-link:active {
  opacity: 0.75;
}

.topbar-compact {
  justify-content: center;
}

.topbar-compact .bidi-line {
  max-width: 640px;
  margin: 0 auto;
  justify-content: space-between;
}

.topbar-compact .lang-en,
.topbar-compact .lang-ar {
  flex: 1;
}

.topbar-compact .brand {
  margin: 0 18px;
}

.subtitle-en {
  font-size: 20px;
}

.controls-center {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.controls-center .circle-filters {
  align-items: center;
  margin-left: 0;
}

.controls-center .circle-row {
  justify-content: center;
}
