/* =========================================================
   AI-STYLE.CSS - Power Prospecting Using AI Project
   ========================================================= */

/* -------------------------
   BASE STYLES
   ------------------------- */

body {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  background: #f9f9f9;
  color: #333;
}

/* -------------------------
   LOGO BAR
   ------------------------- */

.ai-logo-bar {
  background-color: #2C3E50;
  padding: 16px 24px;
  display: flex;
  align-items: center;
}

.ai-logo {
  height: 32px;
  width: auto;
}

/* -------------------------
   HERO SECTION
   ------------------------- */

.hero {
  background: #2C3E50;
  color: white;
  text-align: center;
  padding: 60px 20px;
}

.hero h1 {
  font-family: 'Gemunu Libre', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 15px;
  margin-top: 0;
}

.hero p {
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
  opacity: 0.95;
}

/* -------------------------
   COURSE GRID
   ------------------------- */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 60px;
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* -------------------------
   FLIP CARDS (3D Effect)
   ------------------------- */

.flip-card {
  background: transparent;
  perspective: 1000px;
  width: 100%;
  height: 340px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease-in-out;
  transform-style: preserve-3d;
  transform-origin: center;
}

/* Trigger flip on hover */
.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

/* -------------------------
   FLIP CARD SIDES (Front & Back)
   ------------------------- */

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 20px;
  backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  top: 0;
  left: 0;
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
}

/* Front Side - White Card */
.flip-card-front {
  background: #ffffff;
  color: #2C3E50;
}

.flip-card-front h2 {
  font-family: 'Gemunu Libre', sans-serif;
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 0 0 15px 0;
  text-align: center;
  font-weight: 600;
}

.flip-card-front p {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.flip-card-front img {
  display: block;
}

/* Back Side - Dark Card with Details */
.flip-card-back {
  background: #2C3E50;
  color: white;
  transform: rotateY(180deg);
  padding: 30px 20px;
}

.flip-card-back h3 {
  font-family: 'Gemunu Libre', sans-serif;
  font-size: 1.2rem;
  margin: 0 0 15px 0;
  text-align: center;
  width: 100%;
  max-width: 90%;
  font-weight: 600;
}

.flip-card-back p {
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 12px;
  text-align: center;
  width: 100%;
  max-width: 90%;
  opacity: 0.95;
}

.flip-card-back button {
  padding: 10px 20px;
  background: #F39C12;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  align-self: center;
  margin-top: 12px;
  transition: background 0.3s ease, transform 0.2s ease;
}

.flip-card-back button:hover {
  background: #E67E22;
  transform: translateY(-2px);
}

.flip-card-back button:active {
  transform: translateY(0);
}

/* -------------------------
   LIGHTBOX MODAL
   ------------------------- */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lightbox-content {
  position: relative;
  width: 90vw;
  height: 85vh;
  background: #fff;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lightbox iframe {
  width: 100%;
  height: 100%;
  border: none;
  flex-grow: 1;
  border-radius: 0 0 8px 8px;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  z-index: 10000;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease, color 0.3s ease;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #000;
}

/* -------------------------
   FOOTER
   ------------------------- */

.portfolio-footer {
  background: #2C3E50;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
}

.portfolio-footer a {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.85;
  transition: opacity 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.portfolio-footer a:hover {
  opacity: 1;
}

.portfolio-icon {
  font-size: 1.2rem;
  display: inline-block;
  transition: transform 0.3s ease;
}

.portfolio-footer a:hover .portfolio-icon {
  transform: translateX(-4px);
}

/* -------------------------
   RESPONSIVE DESIGN
   ------------------------- */

/* Tablets */
@media (max-width: 768px) {
  .ai-logo-bar {
    padding: 12px 20px;
  }
  
  .ai-logo {
    height: 28px;
  }
  
  .hero {
    padding: 50px 20px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .course-grid {
    gap: 40px;
    padding: 40px 20px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  
  .flip-card {
    height: 320px;
  }
  
  .flip-card-back h3 {
    font-size: 1.1rem;
  }
  
  .flip-card-back p {
    font-size: 0.8rem;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .ai-logo-bar {
    padding: 10px 15px;
  }
  
  .ai-logo {
    height: 24px;
  }
  
  .hero {
    padding: 40px 15px;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .course-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px 15px;
  }
  
  .flip-card {
    height: 300px;
  }
  
  .flip-card-front h2 {
    font-size: 1rem;
  }
  
  .flip-card-back {
    padding: 25px 15px;
  }
  
  .flip-card-back h3 {
    font-size: 1rem;
  }
  
  .flip-card-back p {
    font-size: 0.75rem;
  }
  
  .flip-card-back button {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  
  /* Lightbox adjustments for mobile */
  .lightbox-content {
    width: 95vw;
    height: 90vh;
  }
  
  .close-btn {
    width: 36px;
    height: 36px;
    font-size: 1.8rem;
  }
  
  /* Footer */
  .portfolio-footer {
    padding: 15px;
  }
  
  .portfolio-footer a {
    font-size: 0.85rem;
  }
}

/* Small mobile devices */
@media (max-width: 400px) {
  .hero h1 {
    font-size: 1.5rem;
  }
  
  .hero p {
    font-size: 0.9rem;
  }
  
  .flip-card {
    height: 280px;
  }
  
  .flip-card-front img {
    width: 120px;
    height: 120px;
  }
}

/* -------------------------
   ACCESSIBILITY
   ------------------------- */

/* Focus styles for keyboard navigation */
.flip-card-back button:focus,
.close-btn:focus {
  outline: 3px solid #F39C12;
  outline-offset: 2px;
}

.portfolio-footer a:focus {
  outline: 2px solid white;
  outline-offset: 4px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .flip-card-inner {
    transition: none;
  }
  
  .flip-card-back button {
    transition: none;
  }
  
  .portfolio-icon {
    transition: none;
  }
}

/* -------------------------
   PRINT STYLES
   ------------------------- */

@media print {
  .ai-logo-bar,
  .hero {
    background: white;
    color: #2C3E50;
  }
  
  .flip-card {
    break-inside: avoid;
  }
  
  .flip-card-inner {
    transform: none !important;
  }
  
  .flip-card-back {
    display: none;
  }
  
  .lightbox,
  .portfolio-footer {
    display: none;
  }
}