/* 
 * Finance Compass Tanzania - Main Stylesheet
 * Modern dark theme with 2025 color trends
 * Mobile-first approach
 */

/* Base Styles & CSS Reset */
:root {
  --dark-bg: #121212;
  --darker-bg: #0A0A0A;
  --secondary-bg: #1E1E1E;
  --card-bg: #262626;
  --primary-accent: #57C5B6;
  --secondary-accent: #8B5CF6;
  --text-light: #F0F0F0;
  --text-gray: #9CA3AF;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

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

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

body {
  font-family: 'Lato', sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

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

a {
  color: var(--primary-accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-accent);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.75rem;
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary-accent);
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1.5rem;
}

.section {
  padding: 3rem 0;
}

/* Header & Navigation */
.header {
  background-color: var(--secondary-bg);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 40px;
  margin-right: 0.5rem;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-light);
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
  display: block;
}

.nav {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  height: 100vh;
  background-color: var(--secondary-bg);
  transition: var(--transition);
  z-index: 1001;
  padding: 2rem;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.nav.active {
  left: 0;
}

.nav-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
}

.nav-list {
  list-style: none;
  margin-top: 2rem;
}

.nav-item {
  margin-bottom: 1.5rem;
}

.nav-link {
  color: var(--text-light);
  font-size: 1.2rem;
  transition: var(--transition);
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link:hover {
  color: var(--primary-accent);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: 'Lato', sans-serif;
}

.btn-primary {
  background-color: var(--primary-accent);
  color: var(--dark-bg);
}

.btn-primary:hover {
  background-color: #48b6a7;
  color: var(--dark-bg);
}

.btn-secondary {
  background-color: var(--secondary-accent);
  color: var(--text-light);
}

.btn-secondary:hover {
  background-color: #7c4de7;
  color: var(--text-light);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-accent);
  color: var(--primary-accent);
}

.btn-outline:hover {
  background-color: var(--primary-accent);
  color: var(--dark-bg);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 60vh;
  object-fit: cover;
  filter: brightness(0.5);
}

.hero-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(
    to bottom,
    rgba(18, 18, 18, 0.3),
    rgba(18, 18, 18, 0.8)
  );
}

.hero-title {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  max-width: 600px;
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.card-img {
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.card-img img {
  transition: var(--transition);
}

.card:hover .card-img img {
  transform: scale(1.05);
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.card-text {
  color: var(--text-gray);
  margin-bottom: 1rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

/* Feature Blocks */
.features {
  padding: 3rem 0;
}

.feature {
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: var(--secondary-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--primary-accent);
  font-size: 1.5rem;
}

.feature-title {
  margin-bottom: 0.5rem;
}

.feature-text {
  color: var(--text-gray);
}

/* Case Studies */
.case-study {
  margin-bottom: 3rem;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.case-study-img {
  height: 200px;
  overflow: hidden;
}

.case-study-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.case-study:hover .case-study-img img {
  transform: scale(1.05);
}

.case-study-content {
  padding: 1.5rem;
}

.case-study-title {
  margin-bottom: 1rem;
}

.case-result {
  display: flex;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.result-item {
  flex: 1;
  text-align: center;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-accent);
  margin-bottom: 0.25rem;
}

.result-label {
  font-size: 0.875rem;
  color: var(--text-gray);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--border-radius);
  border: 1px solid #333;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  font-family: 'Lato', sans-serif;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 2px rgba(87, 197, 182, 0.25);
}

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

.form-submit {
  margin-top: 1rem;
  width: 100%;
}

/* Contact Section */
.contact-info {
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.contact-icon {
  width: 40px;
  height: 40px;
  background: var(--secondary-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  color: var(--primary-accent);
  font-size: 1rem;
}

.contact-text {
  color: var(--text-gray);
}

.contact-text strong {
  display: block;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

/* Footer */
.footer {
  background-color: var(--secondary-bg);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.footer-logo img {
  height: 40px;
  margin-right: 0.5rem;
}

.footer-about {
  margin-bottom: 2rem;
}

.footer-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  position: relative;
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--primary-accent);
}

.footer-links {
  list-style: none;
}

.footer-link-item {
  margin-bottom: 0.75rem;
}

.footer-link {
  color: var(--text-gray);
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--primary-accent);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-gray);
  font-size: 0.875rem;
}

/* Cookie Consent */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--card-bg);
  padding: 1rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.cookie-consent.show {
  transform: translateY(0);
}

.cookie-text {
  margin-bottom: 1rem;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 500px;
  background-color: var(--secondary-bg);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  z-index: 1002;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cookie-settings-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.cookie-category {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cookie-category-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: .4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--primary-accent);
}

input:focus + .toggle-slider {
  box-shadow: 0 0 1px var(--primary-accent);
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.cookie-settings-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Phone Input Styles */
.iti {
  width: 100%;
  margin-bottom: 1rem;
}

.iti__flag {
  background-image: url("https://cdn.jsdelivr.net/npm/intl-tel-input@19.5.1/build/img/flags.png");
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .iti__flag {
    background-image: url("https://cdn.jsdelivr.net/npm/intl-tel-input@19.5.1/build/img/flags@2x.png");
  }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1010;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--secondary-bg);
  border-radius: var(--border-radius);
  padding: 2rem;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  position: relative;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Section Dividers */
.divider {
  margin: 3rem 0;
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(87, 197, 182, 0),
    rgba(87, 197, 182, 0.5),
    rgba(87, 197, 182, 0)
  );
}

/* Custom Tilt Effect */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

/* Plyr Custom Styles */
.plyr--video {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.plyr--full-ui input[type=range] {
  color: var(--primary-accent);
}

.plyr__control--overlaid {
  background: var(--primary-accent);
}

.plyr--video .plyr__control.plyr__tab-focus,
.plyr--video .plyr__control:hover,
.plyr--video .plyr__control[aria-expanded=true] {
  background: var(--secondary-accent);
}

.plyr__control.plyr__tab-focus {
  box-shadow: 0 0 0 5px rgba(87, 197, 182, 0.5);
}

/* Importance Section */
.importance-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

.stat-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary-accent);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-gray);
}

.importance-content {
  margin: 2rem 0;
}

.importance-content h3 {
  color: var(--primary-accent);
  margin-bottom: 1rem;
}

/* Media Queries for Responsive Design */
@media screen and (min-width: 576px) {
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .hero-subtitle {
    font-size: 1.5rem;
  }
}

@media screen and (min-width: 768px) {
  h1 {
    font-size: 3rem;
  }
  
  .section {
    padding: 4rem 0;
  }
  
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .importance-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .feature {
    flex-direction: row;
  }
  
  .feature-icon {
    margin-right: 1.5rem;
    margin-bottom: 0;
  }
  
  .cookie-text {
    margin-bottom: 0;
    margin-right: 1rem;
  }
  
  .cookie-consent {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .cookie-actions {
    flex-shrink: 0;
  }
}

@media screen and (min-width: 992px) {
  .mobile-menu-btn {
    display: none;
  }
  
  .header-inner {
    padding: 0;
  }
  
  .nav {
    position: static;
    width: auto;
    height: auto;
    background-color: transparent;
    padding: 0;
    box-shadow: none;
  }
  
  .nav-close {
    display: none;
  }
  
  .nav-list {
    display: flex;
    margin-top: 0;
  }
  
  .nav-item {
    margin-bottom: 0;
    margin-left: 2rem;
  }
  
  .nav-link {
    border-bottom: none;
    padding: 1.5rem 0;
    font-size: 1rem;
  }
  
  .hero-content {
    padding: 4rem;
  }
  
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-top {
    grid-template-columns: 2fr 1fr 1fr;
  }
  
  .importance-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media screen and (min-width: 1200px) {
  .container {
    padding: 0 2rem;
  }
  
  .section {
    padding: 5rem 0;
  }
  
  .hero-content {
    padding: 6rem;
  }
}