/* Enhanced color scheme based on book cover gradients */

/* Unvisited link */
a:link {
  color: #37b6a4;
  font-weight: bold;
}

/* Visited link */
a:visited {
  color: #37b6a4;
  text-decoration: none;
  font-weight: bold;
}

/* Mouse over link */
a:hover {
  color: orange;
  text-decoration: none;
  font-weight: bold;
}

/* Selected (active) link */
a:active {
  color: orange;
  text-decoration: none;
  font-weight: bold;
}

body {
    font-family: 'DM+Sans', sans-serif;
    margin: 0;
    background: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
}

h1, h2, h3, .title, .author-name {
    font-family: 'DM+Sans', sans-serif;
}

.container {
    margin: auto;
    padding: 0;
}

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

section {
    padding: 4rem 0;
    text-align: center;
}

/* Adding color to alternating sections */
section:nth-of-type(even) {
    background-color: #f8f9ff;
}

/* Top section with gradient background */
.top-section {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, #1c3b6a 0%, #0e2650 100%);
    color: white;
}

.top-inner {
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5rem;
}

.top-section img {
    width: 300px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-radius: 5px;
}

.top-section .text-content {
    max-width: 400px;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: white;
}

.subtitle {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1.5rem;
}

.buy-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.buy-buttons button:first-child {
    background: #37b6a4;
    color: #fff;
    border: none;
}

.buy-buttons button:hover {
    opacity: 0.8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 30px;
    cursor: pointer;
    border: 2px solid #000000;
    background: transparent;
    transition: 0.3s;
    color: black;
    background-color: white;
    text-decoration: none;
}

.btn-link:first-child {
    background: #37b6a4;
    color: #fff;
    border: 2px solid #000000;
}

.btn-link:hover {
    opacity: 0.8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.amazon-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
}

.button-icon {
    width: 16px !important;
    height: 16px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #1c3b6a;
}

/* Updated Testimonial Carousel Styles */
.testimonials-section {
    padding: 4rem 0;
    background-color: #f8f9ff;
    position: relative;
}

.testimonial-carousel {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
}

.testimonial {
    flex: 0 0 100%;
    font-size: 1.1rem;
    text-align: left;
    font-style: italic;
    background: #f8f9ff;
    padding: 2.5rem;
    box-sizing: border-box;
    min-width: 100%;
    max-width: 100%;
}

/* Author info styling */
.author-info {
    display: flex;
    align-items: center;
    margin-top: 2rem;
}

.author-info img.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid #37b6a4;
    flex-shrink: 0;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-info p {
    margin: 0;
    padding: 0;
    font-weight: bold;
    color: #1c3b6a;
    font-style: normal;
}

.author-info span {
    display: block;
    font-size: 0.9rem;
    color: #666;
    font-style: normal;
    line-height: 1.4;
    padding-top: 0.3rem;
}

/* Controls positioned below testimonials */
.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    position: relative;
    z-index: 10;
}

.carousel-btn {
    background-color: rgba(28, 59, 106, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: #1c3b6a;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin: 0 0.5rem;
}

.carousel-btn:hover {
    background-color: #37b6a4;
    color: white;
    transform: scale(1.1);
}

.carousel-btn:active {
    transform: scale(0.95);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(28, 59, 106, 0.3);
    margin: 0 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover {
    background-color: rgba(55, 182, 164, 0.7);
}

.dot.active {
    background-color: #37b6a4;
    transform: scale(1.3);
}

/* Add visual feedback during drag */
.carousel-track.dragging {
    cursor: grabbing;
}

.carousel-track {
    cursor: grab;
}


/* Add these CSS properties to your existing style2.css file */

/* Improve touch handling specifically for iOS */
.carousel-wrapper {
    -webkit-overflow-scrolling: touch; /* Enable momentum scrolling on iOS */
    touch-action: pan-y pinch-zoom; /* Allow vertical scrolling but capture horizontal */
}

.carousel-track {
    will-change: transform; /* Hardware acceleration hint */
    -webkit-touch-callout: none; /* Prevent callout to copy image, etc when tap to hold */
    -webkit-user-select: none; /* Prevent selection when tapping */
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: pan-y; /* Capture horizontal swipes but allow vertical scrolling */
}

/* Ensure testimonials don't have text selection during swipe */
.testimonial {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Fix for iOS Safari momentum scrolling issues */
@supports (-webkit-overflow-scrolling: touch) {
    .carousel-wrapper {
        overflow-x: hidden;
        overflow-y: auto;
    }
    
    .testimonial {
        -webkit-transform: translateZ(0); /* Prevent flickering during animation on iOS */
    }
}

/* Video Section Styling - Bulletproof approach */
.video-section {
    padding: 4rem 0;
    background: #ffffff;
    text-align: center;
    width: 100%;
}

.video-section h2 {
    color: #1c3b6a;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.video-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.video-container {
    width: 800px;
    max-width: 90%;
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.video-container::before {
    content: "";
    display: block;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.more-details {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
    margin-top: 2rem;
    font-size: 1.2rem;
    color: #333;
}

.more-details strong {
    color: #1c3b6a;
}

/* Modified highlight section (former quote box) */
.highlight-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fb 100%);
}

.highlight-section p {
    font-size: 1.7rem;
    line-height: 1.5;
    color: #1c3b6a;
    max-width: 90%;
    margin: 0 auto;
}

.highlight-section strong {
    color: #37b6a4;
}

/* Five learnings with gradient background */
.learnings-section {
    background: linear-gradient(180deg, #ffffff 0%, #f0f7ff 100%);
    padding-bottom: 6rem;
}

.five-learnings {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.learning-item {
    background: #f8f9ff;
    padding: 1.5rem 2rem;
    font-size: 1.4rem;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    width: 70%;
    margin: 1rem 0;
    text-align: center;
    position: relative;
    z-index: 1;
    border: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.3s ease, 
                border-left 0.3s ease;
    line-height: 1.6;
    cursor: pointer;
}

.learnings-section h2 {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
}

.learning-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(55, 182, 164, 0.1);
}

.learning-item.active {
    border-left: 3px solid #37b6a4;
    box-shadow: 0 5px 20px rgba(55, 182, 164, 0.2);
    position: relative;
    z-index: 10;
}

/* Author section styling */
.author-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef5ff 100%);
}

.about-author img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(28, 59, 106, 0.2);
    border: 3px solid white;
}

.author-name {
    font-weight: bold;
    font-size: 1.6rem;
    margin: 1.2rem 0 0.5rem;
    color: #1c3b6a;
}

.author-bio {
    color: #444;
    width: 90%;
    max-width: 900px;
    text-align: left;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.8;
}

.section-content {
    width: 100%;
    margin: 0 auto;
    text-align: left;
}

.table-of-content {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
    line-height: 2;
    text-align: left;
}

.toc-item {
    font-size: 1.2rem;
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.6rem;
    line-height: 1.6;
    text-indent: -1.2rem;
}

/* Problem solution section with accent color */
.problem-solution-section h2 {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
    color: #1c3b6a;
    position: relative;
    padding-bottom: 1rem;
}

.problem-solution-section h2:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #1c3b6a, #37b6a4);
}

/* TOC section styling */
.toc-section {
    background: #f8f9ff;
    padding: 4rem 0;
}

.toc-item strong {
    color: #1c3b6a;
}

/* INTERACTIVE LEARNING ITEMS STYLING */

/* Fixed expandable content styling */
.expanded-content {
    height: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.215, 0.61, 0.355, 1), 
                opacity 0.4s cubic-bezier(0.215, 0.61, 0.355, 1),
                padding 0.4s cubic-bezier(0.215, 0.61, 0.355, 1),
                margin 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    background: #f0f7ff;
    border-left: 3px solid #37b6a4;
    text-align: left;
    font-size: 1rem;
    line-height: 1.6;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    width: 60%;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    box-sizing: border-box; /* Ensure padding is included in height calculation */
    will-change: max-height, opacity, padding, margin; /* Hardware acceleration hint */
}

.expanded-content.visible {
    max-height: 1000px;
    opacity: 1;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
}

/* Plus/minus indicator with improved animation */
.expand-indicator {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #1c3b6a;
    font-weight: bold;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* When active, rotate the indicator */
.learning-item.active .expand-indicator {
    transform: translateY(-50%) rotate(180deg);
}

/* Add focus state for keyboard navigation */
.learning-item:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(55, 182, 164, 0.5), 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Remove animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .expanded-content,
    .expand-indicator,
    .learning-item,
    .carousel-track,
    .testimonial,
    .dot,
    .carousel-btn {
        transition: none !important;
        animation: none !important;
    }
}

.highlight-section img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Mobile Styles (below 768px) */
@media (max-width: 767px) {
    .top-inner {
        flex-direction: column;
        gap: 2rem;
    }
    
    .learning-item {
        width: 90%;
    }
    
    .expanded-content {
        width: 90%;
    }
    
    .highlight-section p {
        font-size: 1.25rem;
    }
    
    .author-bio {
        width: 100%;
    }
    
    .testimonial-carousel {
        padding: 0;
    }
    
    .testimonial {
        padding: 1.5rem;
        font-size: 1rem;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    .author-info span {
        font-size: 0.8rem;
    }
}
