/* ==========================================================================
   CSS Variables & Design Tokens
   ========================================================================== */
:root {
  --primary-color: #ff6363;
  --text-dark: #484848;
  --text-light: #ffffff;
  --bg-dark: #000000;
  --bg-footer: #484848;
  --font-main: "Raleway", sans-serif;
  --transition-fast: 0.2s ease-in-out;
  --transition-normal: 0.3s ease-out;
  --transition-slow: 0.6s ease-in-out;
}

/* ==========================================================================
   Base & General Styles
   ========================================================================== */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  position: relative;
  right: 0;
  transition: right 0.2s ease-in-out;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

a {
  text-decoration: none;
}

h1, h2 {
  color: var(--primary-color);
  font-weight: bold;
}

p {
  font-size: 18px;
  color: var(--text-dark);
}

.section {
  text-align: center;
  padding: 80px 20px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.navbar {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 500;
  background-color: transparent;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.navbar--scrolled {
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar--scrolled .navbar__links a {
  color: var(--text-dark);
}

.navbar__brand {
  position: absolute;
  right: 20px;
  top: 10px;
  z-index: 600;
}

.navbar__links {
  width: 100%;
  text-align: left;
  padding-left: 20px;
}

.navbar__links li {
  display: inline-block;
  padding: 20px 15px;
  font-size: 16px;
}

.navbar__links a {
  color: var(--text-light);
  font-weight: bold;
  transition: color var(--transition-fast);
}

.navbar__links a:hover {
  color: var(--primary-color) !important;
}

.navbar__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--primary-color);
  position: absolute;
  left: 20px;
  top: 15px;
  z-index: 600;
  cursor: pointer;
  font-size: 24px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url("https://images.unsplash.com/photo-1517694712202-14dd9538aa97?auto=format&fit=crop&w=1600&q=80") no-repeat center center;
  background-size: cover;
}

.hero-section__content {
  max-width: 700px;
  padding: 20px;
}

.hero-section__content h1 {
  color: #ffffff;
  font-size: 42px;
  margin-bottom: 20px;
}

.hero-section__subtitle {
  color: var(--text-light);
  font-weight: 300;
  font-size: 22px;
}

.hero-section__scroll-btn {
  background: none;
  border: none;
  color: var(--primary-color) !important;
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  font-size: 28px;
}

/* Bounce Animation */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
  40% { transform: translate(-50%, -20px); }
  60% { transform: translate(-50%, -10px); }
}

.bounce {
  animation: bounce 2s infinite;
}

.blinking-cursor {
  font-weight: 500;
  margin-right: 4px;
  color: var(--primary-color);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  from, to { color: transparent; }
  50% { color: var(--primary-color); }
}

/* ==========================================================================
   Skills Section & Progress Colors
   ========================================================================== */
.container-skillbar {
  width: 100%;
  max-width: 700px;
  margin: 30px auto 0;
}

.skillbar {
  position: relative;
  display: block;
  margin-bottom: 20px;
  width: 100%;
  background: #efefef;
  height: 35px;
  border-radius: 4px;
  overflow: hidden;
}

.skillbar__title {
  position: absolute;
  top: 0;
  right: 0;
  width: 130px;
  font-weight: bold;
  font-size: 13px;
  color: var(--text-light);
  height: 35px;
  line-height: 35px;
  z-index: 2;
}

.skillbar__title span {
  display: block;
  background: rgba(0, 0, 0, 0.2);
  padding: 0 15px;
  text-align: center;
}

.skillbar__bar {
  height: 35px;
  width: 0;
  border-radius: 4px;
  transition: width 1.5s ease-out;
}

.skillbar__percent {
  position: absolute;
  left: 15px;
  top: 0;
  font-size: 12px;
  height: 35px;
  line-height: 35px;
  color: rgba(0, 0, 0, 0.6);
  font-weight: bold;
  z-index: 2;
}

/* تخصيص ألوان شريط المهارات */
.skillbar--html { background-color: #e44d26 !important; }
.skillbar--css { background-color: #264de4 !important; }
.skillbar--js { background-color: #f7df1e !important; }
.skillbar--php { background-color: #777bb4 !important; }
.skillbar--wordpress { background-color: #21759b !important; }

/* إصلاح لون نص عنوان JavaScript الوضوح */
.skillbar__title.skillbar--js span {
  color: #323330;
}

/* ==========================================================================
   Portfolio Section
   ========================================================================== */
.content {
  margin: 0 auto;
  max-width: 800px;
  padding: 0 20px;
}

.portfolio-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
}

.portfolio-img {
  width: 100%;
  max-width: 360px;
  height: 230px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.portfolio-img:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Contact Section & Alerts
   ========================================================================== */
.contact-form {
  max-width: 600px;
  margin: 30px auto 0;
}

.form-control {
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  width: 100%;
  font-size: 16px;
  padding: 12px 15px;
  margin-bottom: 15px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.btn {
  outline: none;
  padding: 12px 30px;
  border-radius: 4px;
  border: 2px solid var(--primary-color);
  font-size: 16px;
  color: var(--primary-color);
  background-color: transparent;
  font-weight: bold;
  cursor: pointer;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

.btn:hover {
  background-color: var(--primary-color);
  color: var(--text-light);
}

/* Form Messages Alerts */
#form-messages {
  display: none;
  padding: 12px 15px;
  margin-bottom: 15px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 15px;
}

#form-messages.success {
  display: block;
  color: #155724;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
}

#form-messages.error {
  display: block;
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background-color: var(--bg-footer);
  padding: 20px 0;
  text-align: center;
}

.footer p {
  color: var(--text-light);
  margin: 0;
  font-size: 15px;
}

/* ==========================================================================
   Media Queries (Responsive Layout)
   ========================================================================== */
@media (max-width: 768px) {
  .hero-section__content h1 {
    font-size: 32px;
  }

  .navbar__toggle {
    display: block;
  }

  .navbar__links {
    display: none; /* إخفاء الأزرار في الهواتف */
  }

  .navbar__links--open {
    display: block !important;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    padding: 0;
  }

  .navbar__links--open li {
    display: block;
    text-align: center;
    border-bottom: 1px solid #eee;
  }

  .navbar__links--open a {
    color: var(--text-dark) !important;
  }
}
