/*
 * Log Academy – main stylesheet
 *
 * The colour palette is based around the brand colours: vibrant orange paired
 * with complementary light neutrals. CSS variables are used to keep the
 * scheme consistent across the site. Most styles were adapted from the
 * prototype static site and refactored for the Flask templates.
 */

/* Root variables */
:root {
  --primary-color: #ff7a00;        /* Vibrant orange */
  --primary-dark: #d66300;        /* Darker orange for hover */
  --secondary-color: #ffa726;      /* Light orange for secondary buttons */
  --light-color: #fdfaf6;         /* Very light off-white background */
  --dark-color: #0a192f;          /* Dark background for footer */
  --text-color: #333333;          /* Primary text colour */
  --muted-text: #6a7a90;          /* Muted text for subtitles */
  --heading-font: 'Montserrat', sans-serif;
  --body-font: 'Poppins', sans-serif;
}

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

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Helper classes */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

#header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Further reduce header height by lowering vertical padding */
  padding: 0.3rem 0;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  /* Reduce right margin so logo sits closer to the left */
  margin-right: 1rem;
}

.logo-space {
  /* Make the logo placeholder smaller */
  width: 32px;
  height: 32px;
  border-radius: 4px;
  /* intentionally left blank for real logo */
}

.brand-name {
  font-family: var(--heading-font);
  font-weight: 700;
  /* Reduce brand font size for a more compact header */
  font-size: 1.15rem;
  color: var(--primary-color);
}

nav ul {
  display: flex;
  gap: 1.5rem;
  font-weight: 500;
}

nav a {
  color: var(--text-color);
  transition: color 0.3s;
  /* Reduce navigation link font size */
  font-size: 0.85rem;
}

nav a:hover {
  color: var(--primary-color);
}

.cta-btns {
  margin-left: 1rem;
}

.nav-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Language selector (dropdown) */
.lang-select {
  margin-left: 1rem;
}
.lang-select select {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: var(--text-color);
  cursor: pointer;
}
.lang-select select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Buttons */
.btn {
  display: inline-block;
  /* Reduce button padding for a slimmer appearance */
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 600;
  transition: background-color 0.3s ease;
  text-align: center;
}
.primary-btn {
  background: var(--primary-color);
  color: #fff;
}
.primary-btn:hover {
  background: var(--primary-dark);
}
.secondary-btn {
  background: var(--secondary-color);
  color: #fff;
}
.secondary-btn:hover {
  background: var(--primary-color);
}

/* Hero */
#hero {
  /* Increase hero height to give the introduction section more prominence */
  height: 90vh;
  background-image: url('../assets/hero.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 1rem;
}

.hero-content h1 {
  font-family: var(--heading-font);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero-content p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: #f5f5f5;
}

/* Sections */
.section {
  padding: 5rem 0 4rem;
}
.light-bg {
  background-color: var(--light-color);
}
.section-title {
  font-family: var(--heading-font);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}
.section-subtitle {
  text-align: center;
  color: var(--muted-text);
  margin-bottom: 3rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.98rem;
}

/* Advantages */
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.advantage-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
}
.advantage-card:hover {
  transform: translateY(-6px);
}
.adv-icon {
  font-size: 2.4rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}
.advantage-card h3 {
  font-family: var(--heading-font);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.advantage-card p {
  color: var(--muted-text);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Results */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  justify-items: center;
  margin-top: 2rem;
}
.result-item {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  max-width: 200px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.result-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}
.result-item h3 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}
.result-item p {
  color: var(--muted-text);
  font-size: 0.9rem;
}

/* Courses */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}
.course-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.course-card:hover {
  transform: translateY(-6px);
}
.course-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}
.course-card h3 {
  font-family: var(--heading-font);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.course-card ul li {
  font-size: 0.95rem;
  color: var(--muted-text);
  margin-bottom: 0.3rem;
  position: relative;
  padding-left: 0.8rem;
}
.course-card ul li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary-color);
  font-size: 1rem;
  line-height: 1;
}

/* Instructors */
.instructors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
.instructor-card {
  background: #fff;
  border-radius: 12px;
  text-align: center;
  padding: 2rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
  height: 100%;
}
.instructor-card:hover {
  transform: translateY(-6px);
}
.instr-photo {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}
.instructor-card h3 {
  font-family: var(--heading-font);
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}
.instructor-card p {
  font-size: 0.9rem;
  color: var(--muted-text);
}
.instructor-card span {
  font-size: 0.8rem;
  color: #8a97ad;
}

/* Testimonials */
#testimonials {
  position: relative;
}
.testimonial-slider {
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}
.testimonial-card {
  display: none;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  text-align: center;
}
.testimonial-card.active {
  display: block;
}
.testimonial-card p {
  font-style: italic;
  margin-bottom: 1rem;
  color: var(--muted-text);
}
.testimonial-card h3 {
  font-family: var(--heading-font);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.testimonial-card span {
  font-size: 0.9rem;
  color: #8a97ad;
}
.testimonial-controls {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.testimonial-controls button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s;
}
.testimonial-controls button:hover {
  background: var(--primary-dark);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  align-items: start;
}
.contact-info h3,
.contact-form h3 {
  font-family: var(--heading-font);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}
.contact-info p {
  font-size: 0.95rem;
  color: var(--muted-text);
  margin-bottom: 0.6rem;
}
.contact-form .form-group {
  margin-bottom: 1rem;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #dcdfe8;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--body-font);
  background: #fff;
  color: var(--text-color);
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
}
.contact-form button {
  width: 100%;
}

/* Footer */
#footer {
  background: var(--dark-color);
  color: #fff;
  padding: 2rem 0;
}
#footer .footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
#footer .footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#footer .footer-logo .logo-space {
  width: 35px;
  height: 35px;
  border-radius: 4px;
}
#footer .footer-logo .brand-name {
  font-family: var(--heading-font);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--primary-color);
}
#footer .footer-social a {
  color: #fff;
  margin: 0 0.5rem;
  font-size: 1.2rem;
  transition: color 0.3s;
}
#footer .footer-social a:hover {
  color: var(--primary-color);
}
#footer .footer-bottom {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #a8b7c8;
}

/* Scroll to Top */
#scrollToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 100;
}
#scrollToTop:hover {
  background: var(--primary-dark);
}

/* Blog listing specific styles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.blog-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.blog-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-card-content h3 {
  font-family: var(--heading-font);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.blog-card-content p.date {
  font-size: 0.85rem;
  color: #8a97ad;
  margin-bottom: 0.5rem;
}
.blog-card-content p.excerpt {
  font-size: 0.95rem;
  color: var(--muted-text);
  margin-bottom: 1rem;
  flex-grow: 1;
}
.blog-card-content .read-more {
  align-self: flex-start;
}

/* Admin pages */
.admin-container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 5rem 0 4rem;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.admin-header h1 {
  font-size: 1.5rem;
  font-family: var(--heading-font);
}
.admin-nav a {
  margin-right: 1rem;
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.95rem;
}
.admin-nav a:hover {
  text-decoration: underline;
}
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}
.table th,
.table td {
  border: 1px solid #e5e5e5;
  padding: 0.75rem;
  font-size: 0.95rem;
}
.table th {
  background: var(--light-color);
  text-align: left;
}
.admin-form {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.admin-form .form-group {
  margin-bottom: 1rem;
}
.admin-form label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 500;
}
.admin-form input[type="text"],
.admin-form input[type="file"],
.admin-form textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid #dcdfe8;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--body-font);
}
.admin-form textarea {
  resize: vertical;
  min-height: 150px;
}
.admin-form button {
  padding: 0.7rem 1.5rem;
  border-radius: 50px;
  border: none;
  font-weight: 600;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
}
.admin-form button:hover {
  background: var(--primary-dark);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  nav ul {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 220px;
    height: calc(100% - 70px);
    background: #fff;
    flex-direction: column;
    padding: 2rem 1rem;
    gap: 1rem;
    transition: right 0.3s ease;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05);
    z-index: 999;
  }
  nav ul.open {
    right: 0;
  }
  .nav-toggle {
    display: block;
    color: var(--text-color);
  }
  .cta-btns {
    display: none;
  }
  .hero-content h1 {
    font-size: 2rem;
  }
  .hero-content p {
    font-size: 0.95rem;
  }
  .courses-grid,
  .advantages-grid,
  .results-grid,
  .instructors-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Language switcher */
.lang-switch {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: 1rem;
}

.lang-switch a {
  font-size: 0.9rem;
  color: var(--text-color);
  text-decoration: none;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lang-switch a:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.lang-switch a.active {
  font-weight: 600;
  border-color: var(--primary-color);
  color: var(--primary-color);
}