/* 
 * Main CSS file for Almog Shtaigmann's Portfolio
 * Modern, clean design using CSS variables for theming
 */

:root {
  /* Color Palette */
  --primary-color: #004080;
  --primary-dark: #002a60;
  --primary-light: #0366d6;
  --secondary-color: #f0f4f8;
  --text-color: #333333;
  --light-text: #ffffff;
  --link-color: #0366d6;
  --link-hover: #005cc5;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --error-color: #dc3545;
  --border-color: #e1e4e8;

  /* Typography */
  --font-main: "Roboto", sans-serif;
  --font-heading: "Roboto", sans-serif;
  --font-code: "Courier New", monospace;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;

  /* Border Radius */
  --border-radius-sm: 3px;
  --border-radius-md: 5px;
  --border-radius-lg: 10px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Container Widths */
  --container-sm: 540px;
  --container-md: 720px;
  --container-lg: 960px;
  --container-xl: 1140px;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--secondary-color);
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* Container & Layout */
.container {
  width: 100%;
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-xl) 0;
}

/* Grid System */
.grid {
  display: grid;
  grid-gap: var(--spacing-md);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  color: var(--primary-color);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: var(--spacing-md);
}

/* Header & Navigation */
header {
  background-color: var(--primary-color);
  color: var(--light-text);
  padding: var(--spacing-md) 0;
  box-shadow: var(--shadow-md);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

.site-title a {
  color: var(--light-text);
  text-decoration: none;
}

.nav-main {
  display: flex;
  gap: var(--spacing-lg);
}

.nav-main a {
  color: var(--light-text);
  text-decoration: none;
  font-weight: 500;
  transition: opacity var(--transition-normal);
}

.nav-main a:hover {
  opacity: 0.8;
  text-decoration: none;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--light-text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Cards */
.card {
  background-color: #fff;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-lg);
  transition: transform var(--transition-normal),
    box-shadow var(--transition-normal);
  margin-bottom: 10px;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 1.3rem;
  margin-bottom: var(--spacing-md);
}

.card-content {
  margin-bottom: var(--spacing-md);
}

.experience-list {
  margin-left: 20px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: var(--primary-color);
  color: var(--light-text);
  border: none;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-normal);
  text-align: center;
}

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

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

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

/* Footer */
footer {
  background-color: var(--primary-color);
  color: black;
  padding: var(--spacing-xl) 0;
  margin-top: var(--spacing-xxl);
}

.footer-content {
  color: #00ff94;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: var(--spacing-md);
}

.footer-links a {
  color: var(--light-text);
  opacity: 0.8;
  transition: opacity var(--transition-normal);
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: none;
}

.social-links {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
}

.social-links-footer {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
}

/* Note: Additional .social-links item styles are in home-styles.css for homepage */
/* Note: .profile-section, .profile-photo, .profile-content moved to home-styles.css */
/* Note: .skills-list and .skill-tag styles moved to home-styles.css for homepage */

/* Note: .skill-tag styles moved to home-styles.css for homepage */

/* Note: Education styles moved to home-styles.css for homepage */

/* Contact FAB */
.contact-fab {
  position: fixed;
  bottom: 20px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--light-text);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-lg);
  z-index: 998;
  transition: transform var(--transition-normal);
}

.contact-fab:hover {
  transform: scale(1.1);
}

.contact-fab a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  color: var(--primary-color);
  font-size: 1.5rem;
}

.contact-fab a img {
  width: 40px;
  height: 40px;
}

/* ============================================
   WhatsApp Floating Action Button (FAB)
   ============================================ */
.whatsapp-fab {
  position: fixed;
  bottom: 95px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 999;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

.whatsapp-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-fab i {
  font-size: 32px;
  color: white;
}

.whatsapp-fab .tooltip {
  position: absolute;
  right: 75px;
  background-color: #128c7e;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.whatsapp-fab .tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent transparent #128c7e;
}

.whatsapp-fab:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

@keyframes pulse {
  0% {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.8),
      0 0 0 10px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  }
}

/* RTL Support for WhatsApp Button */
[dir="rtl"] .whatsapp-fab {
  right: auto;
  left: 30px;
}

[dir="rtl"] .whatsapp-fab .tooltip {
  right: auto;
  left: 75px;
}

[dir="rtl"] .whatsapp-fab .tooltip::after {
  left: auto;
  right: 100%;
  border-color: transparent #128c7e transparent transparent;
}

/* ============================================
   Popup Ad Overlay
   ============================================ */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  text-align: center;
  direction: rtl;
}

.popup-overlay.show .popup-content {
  transform: scale(1);
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  padding: 0;
  line-height: 1;
}

.popup-close:hover {
  color: #333;
}

.popup-content h2 {
  color: #128c7e;
  margin-bottom: 16px;
  font-size: 28px;
}

.popup-content p {
  color: #333;
  margin-bottom: 24px;
  line-height: 1.6;
  font-size: 16px;
}

.popup-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.popup-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.popup-btn-primary {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
}

.popup-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.popup-btn-secondary {
  background: #f0f0f0;
  color: #666;
}

.popup-btn-secondary:hover {
  background: #e0e0e0;
}

/* RTL Support for Popup */
[dir="rtl"] .popup-close {
  right: auto;
  left: 12px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .contact-fab {
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 20px;
  }

  .contact-fab a img {
    width: 30px;
    height: 30px;
  }

  .whatsapp-fab {
    width: 50px;
    height: 50px;
    bottom: 80px;
    right: 20px;
  }

  .whatsapp-fab i {
    font-size: 26px;
  }

  .whatsapp-fab .tooltip {
    right: 65px;
    font-size: 12px;
    padding: 6px 12px;
  }

  [dir="rtl"] .whatsapp-fab {
    left: 20px;
  }

  [dir="rtl"] .whatsapp-fab .tooltip {
    left: 65px;
  }

  .popup-content {
    padding: 24px;
    max-width: 90%;
  }

  .popup-content h2 {
    font-size: 24px;
  }

  .popup-content p {
    font-size: 14px;
  }

  .popup-btn {
    font-size: 14px;
    padding: 10px 20px;
  }
}

/* ============================================
   End of WhatsApp & Popup Styles
   ============================================ */

/* RTL Support */
[dir="rtl"] {
  text-align: right;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mb-sm {
  margin-bottom: var(--spacing-sm);
}

.mb-md {
  margin-bottom: var(--spacing-md);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

.mt-sm {
  margin-top: var(--spacing-sm);
}

.mt-md {
  margin-top: var(--spacing-md);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.hidden {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Footer contact link */
.footer-contact-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-contact-link:hover {
  text-decoration: underline;
}

/* Social icon specific styling */
.social-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  color: var(--primary-color) !important;
  transition: all 0.3s ease;
}

.social-icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.project {
  margin-bottom: 20px;
  border-radius: 10px;
  padding: 10px;
}

.view-on-github {
  background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
  border-color: none;
  color: white;
  padding: 11px;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
}
