/* ==============================================
   MATERIAL DESIGN STYLES
   ============================================== */

/* ===== GOOGLE FONTS ===== */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap");
@import url("https://fonts.googleapis.com/icon?family=Material+Icons");

/* ==============================================
   CSS VARIABLES
   ============================================== */

:root {
  /* Material Design Color Palette */
  --md-primary-color: #3f51b5; /* Indigo */
  --md-primary-color-dark: #303f9f;
  --md-primary-color-light: #c5cae9;
  --md-accent-color: #ffc107; /* Amber */
  --md-accent-color-dark: #ffa000;

  /* Text Colors */
  --md-text-primary-on-light: #212121;
  --md-text-secondary-on-light: #757575;
  --md-text-primary-on-dark: #ffffff;
  --md-text-secondary-on-dark: #bdbdbd;

  /* Other Colors */
  --md-divider-color: #bdbdbd;
  --md-background-color: #f5f5f5;
  --md-surface-color: #ffffff;
  --md-error-color: #d32f2f;

  /* Typography */
  --md-font-family: "Roboto", Arial, sans-serif;
  --md-font-size-base: 16px;
  --md-line-height-base: 1.5;

  /* Spacing */
  --md-spacing-unit: 8px;

  /* Border Radius */
  --md-border-radius: 4px;

  /* Shadows (Elevation) */
  --md-shadow-1: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --md-shadow-2: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  --md-shadow-3: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
  --md-shadow-4: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  --md-shadow-5: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);

  /* Transitions */
  --md-transition-standard: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
}

/* ==============================================
   GLOBAL STYLES
   ============================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--md-font-family);
  font-size: var(--md-font-size-base);
  line-height: var(--md-line-height-base);
  color: var(--md-text-primary-on-light);
  background-color: var(--md-background-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex-grow: 1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 500;
}

h1 {
  font-size: 3rem;
}
h2 {
  font-size: 2.5rem;
  margin-bottom: calc(var(--md-spacing-unit) * 4);
  text-align: center;
  color: var(--md-text-primary-on-light);
}
h3 {
  font-size: 1.75rem;
}
h4 {
  font-size: 1.25rem;
}

a {
  color: var(--md-primary-color);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  color: var(--md-primary-color-dark);
  text-decoration: underline;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--md-spacing-unit) * 3) 0;
}

.section {
  padding: calc(var(--md-spacing-unit) * 8) 0;
  border-bottom: 1px solid var(--md-divider-color);
}

.section:last-of-type {
  border-bottom: none;
}

/* ==============================================
   HEADER & APP BAR
   ============================================== */

.md-header {
  background-color: var(--md-primary-color);
  color: var(--md-text-primary-on-dark);
  box-shadow: var(--md-shadow-3);
}

.md-app-bar {
  background-color: rgba(0, 0, 0, 0.2);
}

.md-app-bar .container {
  padding-top: calc(var(--md-spacing-unit) * 2);
  padding-bottom: calc(var(--md-spacing-unit) * 2);
}

.app-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-bar-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.app-bar-nav {
  display: none;
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: calc(var(--md-spacing-unit) * 2);
}

.app-bar-contact {
  display: flex;
  gap: calc(var(--md-spacing-unit) * 2);
  align-items: center;
}

.app-bar-contact .contact-link span {
  display: none;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: var(--md-spacing-unit);
    color: var(--md-text-secondary-on-dark);
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--md-text-primary-on-dark);
    text-decoration: none;
}

.contact-link .material-icons {
    font-size: 1.5rem;
}

.md-menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--md-text-primary-on-dark);
  cursor: pointer;
  padding: var(--md-spacing-unit);
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.md-menu-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* ==============================================
   MOBILE MENU
   ============================================== */

.md-mobile-menu {
  display: none;
  background-color: var(--md-surface-color);
  padding: calc(var(--md-spacing-unit) * 2);
  border-top: 1px solid var(--md-divider-color);
  box-shadow: var(--md-shadow-2);
}

.md-mobile-menu.is-open {
  display: block;
}

.app-bar-nav-mobile {
  display: flex;
  flex-direction: column;
  gap: var(--md-spacing-unit);
}

.app-bar-nav-mobile a {
  padding: calc(var(--md-spacing-unit) * 1.5);
  border-radius: var(--md-border-radius);
  color: var(--md-text-primary-on-light);
  display: flex;
  align-items: center;
  gap: var(--md-spacing-unit);
}

.app-bar-nav-mobile a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  text-decoration: none;
}


/* ==============================================
   HERO SECTION
   ============================================== */

.hero-section {
  position: relative;
  padding: calc(var(--md-spacing-unit) * 10) 0;
  text-align: center;
  background-size: cover;
  background-position: center;
  color: var(--md-text-primary-on-dark);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: var(--md-spacing-unit);
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: calc(var(--md-spacing-unit) * 4);
  opacity: 0.9;
}

/* ==============================================
   MATERIAL BUTTONS
   ============================================== */

.md-button {
  display: inline-block;
  padding: calc(var(--md-spacing-unit) * 1.5) calc(var(--md-spacing-unit) * 4);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  border-radius: var(--md-border-radius);
  cursor: pointer;
  transition: var(--md-transition-standard);
  border: none;
  text-align: center;
}

.md-button-raised {
  box-shadow: var(--md-shadow-1);
}

.md-button-raised:hover {
  box-shadow: var(--md-shadow-3);
  transform: translateY(-2px);
}

.md-button-accent {
  background-color: var(--md-accent-color);
  color: var(--md-text-primary-on-light);
}

.md-button-accent:hover {
  background-color: var(--md-accent-color-dark);
}

/* ==============================================
   FLOATING ACTION BUTTON (FAB)
   ============================================== */

.md-fab {
  position: fixed;
  bottom: calc(var(--md-spacing-unit) * 3);
  right: calc(var(--md-spacing-unit) * 3);
  width: calc(var(--md-spacing-unit) * 7);
  height: calc(var(--md-spacing-unit) * 7);
  background-color: var(--md-accent-color);
  color: var(--md-text-primary-on-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--md-shadow-3);
  transition: var(--md-transition-standard);
  z-index: 1000;
}

.md-fab:hover {
  background-color: var(--md-accent-color-dark);
  box-shadow: var(--md-shadow-5);
  transform: scale(1.05);
  text-decoration: none;
}

.md-fab .material-icons {
  font-size: calc(var(--md-spacing-unit) * 3);
}


/* ==============================================
   VIDEO SECTION
   ============================================== */

#video-section .video-container {
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--md-border-radius);
  overflow: hidden;
  box-shadow: var(--md-shadow-2);
}

#video-section video {
  width: 100%;
  display: block;
}

/* ==============================================
   GRID & CARDS
   ============================================== */
   
.md-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: calc(var(--md-spacing-unit) * 3);
}

.md-card {
    background-color: var(--md-surface-color);
    border-radius: var(--md-border-radius);
    box-shadow: var(--md-shadow-1);
    overflow: hidden;
    transition: var(--md-transition-standard);
    display: flex;
    flex-direction: column;
}

.md-card:hover {
    box-shadow: var(--md-shadow-3);
    transform: translateY(-4px);
}

.md-card-media {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.md-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-card-content {
    padding: calc(var(--md-spacing-unit) * 2);
    flex-grow: 1;
}

.md-card-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: var(--md-spacing-unit);
}

.md-card-content p {
    color: var(--md-text-secondary-on-light);
}

.text-center-md-card {
    text-align: center;
}

/* ==============================================
   GALLERY SECTION
   ============================================== */

#gallery .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--md-spacing-unit);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--md-border-radius);
    box-shadow: var(--md-shadow-1);
    transition: var(--md-transition-standard);
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--md-shadow-3);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background-color 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

.gallery-item-overlay .material-icons {
    font-size: 3rem;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay .material-icons {
    opacity: 1;
    transform: scale(1);
}

/* ==============================================
   ABOUT SECTION
   ============================================== */

#about .about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--md-spacing-unit) * 4);
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

#about .about-text p, #about .about-text-arabic p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: var(--md-spacing-unit);
}

#about strong {
    color: var(--md-primary-color);
}

/* ==============================================
   CONTACT FORM
   ============================================== */

.md-form {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: calc(var(--md-spacing-unit) * 2);
}

.md-text-field {
    position: relative;
    background-color: rgba(0, 0, 0, 0.06);
    border-top-left-radius: var(--md-border-radius);
    border-top-right-radius: var(--md-border-radius);
    padding-top: calc(var(--md-spacing-unit) * 2);
    transition: background-color 0.3s ease;
}

.md-text-field:hover {
    background-color: rgba(0, 0, 0, 0.09);
}

.md-text-field::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--md-primary-color);
    transition: width 0.3s ease, left 0.3s ease;
}

.md-text-field input,
.md-text-field textarea {
    width: 100%;
    padding: var(--md-spacing-unit) calc(var(--md-spacing-unit) * 1.5) calc(var(--md-spacing-unit) * 1.5);
    border: none;
    background: none;
    font-size: 1rem;
    color: var(--md-text-primary-on-light);
    outline: none;
}

.md-text-field label {
    position: absolute;
    top: 50%;
    left: calc(var(--md-spacing-unit) * 1.5);
    transform: translateY(-50%);
    color: var(--md-text-secondary-on-light);
    transition: all 0.2s ease;
    pointer-events: none;
}

/* Floating label effect */
.md-text-field input:focus + label,
.md-text-field input:valid + label,
.md-text-field textarea:focus + label,
.md-text-field textarea:valid + label {
    top: calc(var(--md-spacing-unit) * 1.5);
    font-size: 0.75rem;
    color: var(--md-primary-color);
}

.md-text-field input:focus::after,
.md-text-field textarea:focus::after {
    width: 100%;
    left: 0;
}

.recaptcha-terms {
    font-size: 12px;
    color: var(--md-text-secondary-on-light);
    text-align: center;
}

.recaptcha-terms a {
    color: var(--md-primary-color);
}

/* ==============================================
   FOOTER
   ============================================== */

.md-footer {
    background-color: var(--md-surface-color);
    border-top: 1px solid var(--md-divider-color);
    padding: calc(var(--md-spacing-unit) * 4) 0 0;
    color: var(--md-text-secondary-on-light);
}

.footer-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: calc(var(--md-spacing-unit) * 2);
    margin-bottom: calc(var(--md-spacing-unit) * 2);
}

.footer-brand h3 {
    color: var(--md-text-primary-on-light);
    font-size: 1.5rem;
}

.footer-nav {
    display: flex;
    gap: calc(var(--md-spacing-unit) * 2);
}

.footer-nav a {
    color: var(--md-text-secondary-on-light);
}

.footer-nav a:hover {
    color: var(--md-primary-color);
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid var(--md-divider-color);
    padding: calc(var(--md-spacing-unit) * 2) 0;
    text-align: center;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
    }
}


@media (min-width: 768px) {
    #about .about-content {
        grid-template-columns: 1fr 1fr;
        gap: calc(var(--md-spacing-unit) * 6);
        text-align: left;
    }
}

/* ==============================================
   RESPONSIVE HEADER
   ============================================== */

@media (min-width: 768px) {
  .app-bar-contact .contact-link span {
    display: inline;
  }
}

@media (min-width: 1024px) {
  .app-bar-nav {
    display: flex;
    gap: calc(var(--md-spacing-unit) * 3);
  }

  .app-bar-nav a {
    color: var(--md-text-secondary-on-dark);
    font-weight: 500;
    transition: color 0.3s ease;
  }

  .app-bar-nav a:hover {
    color: var(--md-text-primary-on-dark);
    text-decoration: none;
  }

  .app-bar-contact {
    display: flex;
    gap: calc(var(--md-spacing-unit) * 3);
  }

  .app-bar-contact .contact-link span {
    display: inline;
  }

  .md-menu-button {
    display: none;
  }
}
