/* Essentials Page Styles */

:root {
    --card-blue: #E3F2FD;
    --card-green: #E8F5E9;
    --card-orange: #FFF3E0;
    --card-purple: #F3E5F5;
    --tag-red: #FF6B6B;
}

/* Hero Section */
.essentials-hero {
    padding: 9.6rem 0 3.1rem;
    background: #fff;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "visual title"
        "visual content";
    gap: 4rem;
    align-items: center;
}

/* Prep Control Panel Hero Visual */
.prep-control-panel {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 5rem auto 0;
    perspective: 1000px;
}

.panel-glass {
    background: rgba(23, 23, 26, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 2.5rem;
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transform: rotateY(-15deg) rotateX(10deg);
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.panel-glass:hover {
    transform: rotateY(-5deg) rotateX(5deg) translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.indicator-group {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
    opacity: 0.6;
}

.dot.yellow {
    background: #ffbd2e;
    opacity: 0.6;
}

.dot.green {
    background: #27c93f;
    opacity: 0.6;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
}

.panel-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

/* Circular Progress */
.completion-container {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.circular-progress {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-progress circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.circular-progress .bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.circular-progress .fg {
    stroke: #d45d5d;
    /* Dull Red */
    stroke-dasharray: 283;
    stroke-dashoffset: 50;
    /* Adjust for 82% */
    transition: stroke-dashoffset 2s ease-out;
    filter: drop-shadow(0 0 10px rgba(212, 93, 93, 0.5));
}

.percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: #fff;
}

.label {
    position: absolute;
    bottom: 25%;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    font-weight: 600;
}

/* Toggles */
.toggle-stack {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.5;
}

.mode-toggle.active {
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.mode-btn {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.mode-toggle.active .mode-btn {
    background: #d45d5d;
    /* Dull Red */
}

.mode-btn::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
}

.mode-toggle.active .mode-btn::after {
    left: 19px;
}

.mode-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Meters */
.meter-grid {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.meter-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 0.8rem;
}

.meter-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.meter-bar .fill {
    height: 100%;
    background: var(--secondary-blue);
    border-radius: 3px;
    position: relative;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Accents & Animations */
.panel-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    filter: blur(60px);
    z-index: -1;
    opacity: 0.2;
    transition: background 1.5s ease;
}

.panel-glow.top {
    top: -50px;
    right: -50px;
    background: var(--primary-yellow);
}

.panel-glow.bottom {
    bottom: -50px;
    left: -50px;
    background: var(--secondary-blue);
}

@keyframes barFill {
    from {
        width: 0;
    }
}

@keyframes circlePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.hero-visual {
    grid-area: visual;
}

.hero-content {
    grid-area: content;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    padding-top: 0;
}

.hero-title {
    grid-area: title;
    font-family: var(--font-heading);
    font-size: 4.2rem;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.25;
    font-weight: 400;
    letter-spacing: -1px;
    margin-top: 6rem;
}

.indent-line {
    display: inline-block;
    margin-left: 7.6rem;
    white-space: nowrap;
    /* Aligned with the start of 'the' in 'All the Prep' */
}

.hero-subline-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 1rem;
    align-items: center;
    text-align: center;
    width: 100%;
}

.hero-subline {
    font-size: 1.6rem;
    color: var(--secondary-blue);
    margin: 0;
}

.hero-subline.italic {
    font-style: italic;
    font-family: var(--font-heading);
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    text-align: center;
    width: 100%;
    transform: translateY(-15%);
    font-style: italic;
}

.essentials-hero-btn {
    align-self: center;
    transform: translateY(-25px);
    background: var(--accent-red);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.7rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.essentials-hero-btn:hover {
    transform: translateY(-28px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    background: #ff5252;
}

/* Essentials Grid Section */
.essentials-grid-section {
    padding: 2.4rem 0 1.4rem;
    background: transparent;
    position: relative;
}

.essentials-grid {
    display: grid;
    /* Create a 4 column, auto row grid to fit items into a tight rectangle */
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    grid-template-rows: repeat(3, 250px) 200px;
    gap: 1.5rem;
    padding: 0 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.grid-item {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    border-radius: 12px;
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.grid-item:hover .item-image {
    transform: scale(1.02);
}

/* Specific sizing for the 6 items to create an interlocking rectangle */
.grid-item:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.grid-item:nth-child(2) {
    grid-column: 3 / 5;
    grid-row: 1 / 2;
}

.grid-item:nth-child(3) {
    grid-column: 3 / 4;
    grid-row: 2 / 4;
}

.grid-item:nth-child(4) {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
}

.grid-item:nth-child(5) {
    grid-column: 1 / 3;
    grid-row: 3 / 4;
}

.grid-item:nth-child(6) {
    grid-column: 4 / 5;
    grid-row: 3 / 4;
}

.grid-item:nth-child(7) {
    grid-column: 1 / 5;
    grid-row: 4 / 5;
}


/* Horizontal Study Flow Section */
.study-journey {
    padding: 1.3rem 0 10rem;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: 1rem;
    font-weight: 300;
}

.horizontal-flow {
    position: relative;
    margin-top: 2.8rem;
    padding: 0 4rem;
}

.flow-path {
    position: absolute;
    top: 50px;
    left: 10%;
    right: 10%;
    height: 100px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.15;
}

.dotted-path {
    stroke: var(--text-dark);
    stroke-width: 2;
    stroke-dasharray: 8, 8;
}

.journey-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    gap: 2rem;
}

.journey-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.step-marker {
    width: 100px;
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    transition: all 0.4s ease;
}

.bg-number {
    font-size: 6rem;
    font-family: var(--font-heading);
    color: rgba(0, 0, 0, 0.20);
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
    transition: all 0.4s ease;
}

.step-info h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.step-info p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    max-width: 200px;
    margin: 0 auto;
}

/* Hover Effects */
.journey-step:hover .bg-number {
    color: #f87171;
    transform: scale(1.1);
    opacity: 0.45;
}

.journey-step:hover h3 {
    color: var(--secondary-blue);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .journey-steps {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4rem;
    }

    .journey-step {
        flex: 0 0 calc(50% - 2rem);
    }

    .flow-path {
        display: none;
    }
}

@media (max-width: 768px) {
    .journey-step {
        flex: 0 0 100%;
    }

    .horizontal-flow {
        padding: 0 2rem;
    }

    .bg-number {
        font-size: 5rem;
    }
}

/* Responsive handled at bottom */

/* Responsive Styles */
@media (max-width: 1200px) {
    .essentials-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Slightly wider tablet view */
        grid-auto-rows: 200px;
    }
}

@media (max-width: 1024px) {

    /* Preserve horizontal flow scaling for tablet too */
    .journey-steps {
        flex-wrap: nowrap !important;
        gap: 1rem;
    }

    .journey-step {
        flex: 1 !important;
    }

    .flow-path {
        display: block !important;
        opacity: 0.1;
    }
}

@media (max-width: 768px) {
    .essentials-hero {
        margin-top: 94px;
        /* Further reduced from 110px by 15% */
        /* Clear the fixed header */
        padding: 0.5rem 0 1.27rem;
        /* Further reduced from 1.44rem by 12% */
        /* Move heading to topmost part */
    }

    .essentials-grid-section {
        padding: 1.52rem 0 0.89rem;
        /* Further reduced from 1.73rem/1.01rem by 12% */
    }

    .hero-grid {
        grid-template-columns: 1fr;
        /* Single column stack for mobile */
        grid-template-areas:
            "title"
            "visual"
            "content";
        gap: 2rem;
        /* Vertical spacing between stacked blocks */
        align-items: center;
        text-align: left;
    }

    .hero-title {
        grid-area: title;
        text-align: left;
        /* Keep clean left-aligned block from previous step */
        align-self: flex-start;
        margin-bottom: 0;
        font-size: 2.1rem;
        line-height: 1.1;
        padding-left: 0;
        margin-top: 4.34rem;
        /* Further reduced from 5.1rem by 15% */
    }

    .hero-visual {
        grid-area: visual;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        margin: 0 auto;
    }

    .hero-content {
        grid-area: content;
        padding-top: 0;
        gap: 1.5rem;
        align-items: center;
        /* Center-align text stack */
        text-align: center;
    }

    .prep-control-panel {
        max-width: 100%;
        margin: 0 auto;
        /* Centered animation */
        transform: scale(0.6);
        /* Slightly smaller scale for centered focus */
        transform-origin: center center;
    }

    .panel-glass {
        padding: 1.25rem;
        border-radius: 15px;
    }

    .indicator-group {
        gap: 4px;
    }

    .dot {
        width: 6px;
        height: 6px;
    }

    .panel-title {
        font-size: 0.5rem;
    }

    .completion-container {
        width: 70px;
        height: 70px;
    }

    .percentage {
        font-size: 1rem;
    }

    .label {
        font-size: 0.4rem;
        bottom: 20%;
    }

    .toggle-stack {
        gap: 0.6rem;
    }

    .mode-btn {
        width: 22px;
        height: 12px;
    }

    .mode-btn::after {
        width: 8px;
        height: 8px;
        top: 2px;
        left: 2px;
    }

    .mode-toggle.active .mode-btn::after {
        left: 12px;
    }

    .mode-text {
        font-size: 0.55rem;
    }

    .meter-grid {
        gap: 0.8rem;
    }

    .meter-label {
        font-size: 0.45rem;
        margin-bottom: 0.4rem;
    }

    .meter-bar {
        height: 3px;
    }



    .indent-line {
        margin-left: 0;
    }

    .hero-subline-group {
        align-items: center;
        text-align: center;
        margin-top: 0.2rem;
    }

    .hero-subline {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 1.03rem;
        text-align: center;
        transform: none;
        margin-top: 0;
    }

    .essentials-hero-btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.8rem;
        transform: none;
    }

    .essentials-hero-btn:hover {
        transform: translateY(-3px);
    }

    /* Proportional Scaling for Smart Study Flow */
    .study-journey {
        padding: 2.5rem 0 4.5rem;
    }

    .study-journey .section-title {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
        text-align: center;
    }

    .study-journey .section-subtitle {
        font-size: 0.65rem;
        margin-top: 0;
        text-align: center;
    }

    .horizontal-flow {
        margin-top: 1.5rem;
        padding: 0 10px;
    }

    .journey-steps {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem;
    }

    .journey-step {
        flex: 1;
        min-width: 0;
        /* Prevents overflow in flexbox */
    }

    .step-marker {
        width: 35px;
        height: 35px;
        margin-bottom: 0.4rem;
    }

    .bg-number {
        font-size: 2.2rem;
    }

    .step-info h3 {
        font-size: 0.55rem;
        margin-bottom: 0.2rem;
    }

    .step-info p {
        font-size: 0.45rem;
        max-width: 100%;
        line-height: 1.3;
    }

    .flow-path {
        top: 15px;
        height: 35px;
        left: 5%;
        right: 5%;
        display: block !important;
        opacity: 0.1;
    }

    .essentials-grid {
        display: flex;
        flex-direction: column;
        gap: 2.1rem;
        /* Reduced from 3.5rem */
        padding: 1rem 2.5%;
        /* Reduced from 5% to allow more width */
        width: 100%;
        margin: 0 auto;
    }

    .essentials-grid::-webkit-scrollbar {
        display: none;
    }

    .grid-item {
        width: 100% !important;
        max-width: 95%;
        /* Increased from 90% */
        margin: 0 auto;
        display: block;
        transition: transform 0.4s ease;
    }

    /* Reset grid positioning for mobile list */
    .grid-item:nth-child(n) {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    /* Focused Card Effect */
    .grid-item:active {
        transform: scale(0.98);
    }

    .item-image {
        width: 100%;
        aspect-ratio: 1 / 1;
        /* Match the Syllabus (2x2) square shape */
        object-fit: cover;
        border-radius: 18px;
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
        display: block;
    }

    /* Pagination Dots Styling */
    .essentials-dots {
        display: flex;
        justify-content: center;
        gap: 12px;
        margin-top: 1rem;
        padding-bottom: 2rem;
    }

    .essentials-dots span {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }

    .essentials-dots span.dot-active {
        background: var(--accent-red);
        width: 25px;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    }



    .indent-line {
        margin-left: 35%;
        display: block;
    }

    .carousel-nav {
        display: none;
    }
}