/* =========================
   CSS Variables (Constants)
========================= */
:root {
    --max-width: 1000px;
    --mobile-max-width: 400px;
    --header-height: 100px;
    --app-min-height: 600px;

    /* Brand Colors */
    --purple4: #330D81;
    --white-stripes: #F4F0DD;
    --purple-haze: #8E00FF;
    --deep-purple: #140037;

    /* Text Colors */
    --text-color: var(--white-stripes);
    --text-hover-color: #F4F0DDA0;

    /* Shadow */
    --header-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --dropdown-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* =========================
     Reset and Base Styles
  ========================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Aggressive override of Flutter's touch handling */
flt-glass-pane,
flt-renderer-container,
flutter-view {
    touch-action: pan-y !important;
    pointer-events: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Ensure proper document scrolling */
html, body {
    height: 100%;
    overflow-y: auto !important;
    touch-action: auto !important;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Basis Grotesque Pro', sans-serif;
    background-color: var(--purple4);
    color: var(--text-color);
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

/* =========================
     Text Styles 
========================= */

.text-dark {
    color: var(--deep-purple);
}
.text-light {
    color: var(--white-stripes);
}

h2 {
    font-family: 'Byrd Simply', sans-serif;
    font-size: 48px;
    font-weight: bold;
    margin: 4px 0 16px;
    text-align: left;
}

h3 {
    font-family: 'Byrd Simply', sans-serif;
    font-size: 28px;
    font-weight: bold;
    margin: 4px 0 16px;
}

p {
    font-family: 'Basis Grotesque Pro', sans-serif;
    font-size: 20px;
    font-weight: 400;
}

span {
    font-family: 'Basis Grotesque Pro', sans-serif;
    font-size: 20px;
}

@media (max-width: 768px) {
    h2 {
        font-size: 32px;
        margin: 4px 0 12px;
    }
    h3 {
        font-size: 24px;
        margin: 4px 0 12px;
    }
}

/* =========================
     Navigation Menu
  ========================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--purple4);
    z-index: 1000;
    box-shadow: var(--header-shadow);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
}

.hamburger.active img {
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

.logo img {
    height: 50px;
    width: auto;
}

nav {
    flex: 1;
    margin-left: 20px;
}

.nav-menu {
    display: flex;
    align-items: left;
    padding-left: 20px;
    justify-content: flex-start;
    width: 100%;
}

.nav-menu li {
    position: relative;
    margin: 0 10px;
}

.nav-menu a,
.dropbtn {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    height: 60px;
    color: var(--text-color);
    font-family: 'Byrd Simply', sans-serif;
    font-weight: 700;
    font-size: 20px;
    transition: color 0.3s, border-bottom 0.3s;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-menu a:hover,
.nav-menu a.active,
.dropbtn:hover,
.dropbtn.active {
    color: var(--text-hover-color);
}

.nav-menu .dropbtn i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.nav-menu .dropdown-content {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100vw;
    background-color: var(--purple4);
    box-shadow: var(--dropdown-shadow);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1001;
}

.nav-menu .dropdown-content-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 0;
    padding-left: 280px;
}

.nav-menu .dropdown-content ul {
    display: flex;
    flex-direction: column;
}

.nav-menu .dropdown-content li a {
    padding: 10px 20px;
    margin-left: 20px;
    color: var(--white-stripes);
    font-size: 16px;
    transition: background 0.3s;
}

.nav-menu .dropdown-content li a:hover {
    color: var(--text-hover-color);
}

.nav-menu .dropdown:hover .dropdown-content,
.nav-menu .dropdown.show .dropdown-content {
    opacity: 1;
    visibility: visible;
}

.nav-menu .dropdown.show .dropbtn i {
    transform: rotate(225deg);
}

.cta {
    background-color: var(--purple-haze);
    color: #fff;
    padding: 10px 25px;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 900;
    display: flex;
    align-items: center;
    transition: background-color 0.3s;
}

.cta:hover {
    background-color: var(--deep-purple);
}

.cta .arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.cta:hover .arrow {
    transform: translateX(5px);
}

/* =========================
     Mobile Navigation
  ========================= */
@media (max-width: 768px) {
    .nav-menu {
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: var(--purple4);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-menu.show {
        max-height: 600px;
        box-shadow: var(--dropdown-shadow);
    }

    .nav-menu li {
        margin: 0;
    }

    .nav-menu a,
    .dropbtn {
        width: 100%;
        text-align: left;
    }

    .nav-menu .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-menu .dropdown-content-inner {
        padding: 20px 0;
    }

    .nav-menu .dropdown-content.show {
        max-height: 600px; /* Adjust as needed */
    }

    .nav-menu .dropdown.show .dropbtn i {
        display: none;
    }

    .cta {
        display: none;
    }

    .hamburger {
        display: block;
    }
}

/* =========================
     App Container
  ========================= */
#app-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-family: 'Byrd Simply', sans-serif;
    font-weight: 800;
    background-color: var(--purple4);
    color: var(--white-stripes);
    margin-top: var(--header-height);
    min-height: var(--app-min-height);
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}


/* =========================
     How To Tune & Tips
========================= */

.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-columns {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 60px;
    width: 100%;
    margin-top: 64px;
}

@media (max-width: 768px) {
    .section-columns {
        flex-direction: column;
        align-items: center;
    }
}

.tune-column {
    flex: 1;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tune-column img {
    width: 100%;
    height: auto;
    max-width: 300px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.tips-column {
    flex: 1;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tips-column img {
    width: 100%;
    height: auto;
    max-width: 400px;
    margin-bottom: 20px;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .tune-column {
        max-width: var(--mobile-max-width);
    }
    .tips-column {
        max-width: var(--mobile-max-width);
    }    
}

/* =========================
     What is Standard Tuning Section
========================= */
.standard-tuning {
    position: relative;
    overflow: hidden;
    background-color: var(--white-stripes);
    background-image: url('../assets/images/standard-tuning-background.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.standard-tuning-container {
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.standard-tuning-content {
    flex: 2;
    max-width: 600px;
    z-index: 1;
}

.standard-tuning-strings {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 30px 0;
}

.standard-tuning-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 40px;
}

.standard-tuning-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .standard-tuning-container {
        flex-direction: column;
        align-items: center;
    }

    .standard-tuning-content {
        max-width: 400px;
        text-align: center;
    }

    .standard-tuning-image-container {
        margin-left: 0;
        margin-bottom: 30px;
    }

    .standard-tuning-image {
        max-width: 200px;
    }
}

.string-item {
    display: flex;
    align-items: center;
    padding: 0px 20px;
}

.play-button {
    width: 40px;
    height: 40px;
    background-color: var(--purple-haze);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 15px;
    transition: background-color 0.3s, transform 0.3s;
}

.play-button img {
    width: 18px;
    height: 18px;
}

.play-button.playing {
    background-color: var(--white-stripes);
    border-radius: 50%;
    border-color: var(--purple-haze);
    border-width: 3px;
    border-style: solid;
}

/* =========================
     When Should I Tune Section
========================= */

.tune-maintenance-container {
    flex-direction: row;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.tune-maintenance-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 40px;
}

.tune-maintenance-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
}

/* Content Styling */
.tune-maintenance-content {
    flex: 1;
    max-width: 600px;
}

.tune-maintenance-title {
    font-family: 'Byrd Simply', sans-serif;
    font-size: 48px;
    font-weight: bold;
    color: var(--white-stripes);
    margin-bottom: 20px;
    text-align: left;
}

.tune-maintenance-description {
    font-family: 'Basis Grotesque Pro', sans-serif;
    font-size: 22px;
    color: var(--white-stripes);
    text-align: left;
}

@media (max-width: 768px) {
    .tune-maintenance-container {
        flex-direction: column;
        align-items: center;
    }

    .tune-maintenance-image-container {
        margin-right: 0;
        margin-bottom: 30px;
    }

    .tune-maintenance-content {
        max-width: var(--mobile-max-width);
        text-align: center;
    }

    .tune-maintenance-image {
        max-width: 300px;
    }
}

/* =========================
     Download App Section
========================= */
.download-app-section {
    background-color: var(--white-stripes);
    background-image: url('../assets/images/download-app-background.svg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    padding: 80px 20px;
    padding-bottom: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.download-app-icon {
    width: 124px;
    height: 124px;
    margin-bottom: 20px;
}

.download-app-title {
    font-family: 'Byrd Simply', sans-serif;
    font-size: 48px;
    font-weight: bold;
    color: var(--deep-purple);
    margin-bottom: 20px;
}

.download-app-button img {
    width: auto;
    height: auto;
    margin: 20px 0;
    max-width: 250px; /* Adjust as needed */
    cursor: pointer;
    transition: transform 0.3s ease;
}

.download-app-button:hover img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .download-app-title {
        font-size: 28px;
    }
    .download-app-description {
        font-size: 16px;
        max-width: 90%;
    }
    .download-app-button img {
        max-width: 200px;
    }
}

/* =========================
     Footer Section
========================= */
.footer {
    background-color: var(--purple4);
    color: var(--white-stripes);
    padding: 80px 20px 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-container {
    max-width: var(--max-width);
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column-logo {
    flex: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    text-align: left; 
}

.footer-columns {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex: 2;
    gap: 40px;
}


.footer-logo-image {
    height: 50px;
    width: auto;
    margin-bottom: 30px;
    margin-left: -8px;
}

.footer-social-icons {
    display: flex;
    gap: 20px;
}

.social-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

.footer-title {
    font-family: 'Basis Grotesque Pro', sans-serif;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
}

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

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    font-family: 'Basis Grotesque Pro', sans-serif;
    font-size: 14px;
    color: var(--white-stripes);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-hover-color);
}

.footer-bottom {
    padding-top: 20px;
    width: 100%;
    max-width: var(--max-width);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    opacity: 0.6;
}

.footer-bottom-link {
    font-family: 'Basis Grotesque Pro', sans-serif;
    font-size: 14px;
    color: var(--white-stripes);
    transition: color 0.3s ease;
}

.footer-bottom-link:hover {
    color: var(--text-hover-color);
}

.footer-bottom-text {
    font-family: 'Basis Grotesque Pro', sans-serif;
    font-size: 14px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        max-width: var(--mobile-max-width);
        gap: 30px;
    }
}

/* The only navigation icon is drawn locally to avoid a remote icon font. */
.nav-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

/* Static tuner preview, visible until Flutter has rendered its first frame. */
.tuner-loading-shell {
    position: absolute;
    inset: 0 0 auto;
    min-height: var(--app-min-height);
    background: var(--purple4);
    z-index: 1;
    opacity: 1;
    transition: opacity 220ms ease-out;
}

.tuner-loading-shell.is-ready {
    opacity: 0;
    pointer-events: none;
}

.tuner-preview {
    position: relative;
    height: 600px;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

.tuner-preview-indicator {
    width: 300px;
    height: 120px;
    margin: 0 auto;
    position: relative;
}

.tuner-preview-indicator img {
    display: block;
    width: 300px;
    height: 95px;
    object-fit: contain;
}

.tuner-preview-cents {
    position: absolute;
    bottom: 0;
    left: 130px;
    width: 40px;
    height: 20px;
    border-radius: 10px;
    background: #ffffff40;
    color: #fff;
    text-align: center;
    font: bold 12px/20px sans-serif;
}

.tuner-preview-guitar {
    position: relative;
    width: 350px;
    height: 480px;
    margin: 0 auto;
}

.tuner-preview-guitar-image {
    position: absolute;
    left: 25px;
    width: 300px;
    height: 480px;
    object-fit: contain;
    mask-image: linear-gradient(to bottom, #000 80%, transparent 95%);
    -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 95%);
}

.tuner-preview-peg {
    position: absolute;
    width: 50px;
    height: 50px;
    background: url('../assets/assets/svgs/tuner/Tuner_Peg_Default.svg') center / cover no-repeat;
    color: #fff;
    text-align: center;
    padding-left: 12px;
    font: bold 20px/50px sans-serif;
}

.tuner-preview-peg.peg-1 { left: 242px; top: 220px; }
.tuner-preview-peg.peg-2 { left: 246px; top: 138px; }
.tuner-preview-peg.peg-3 { left: 249.5px; top: 56px; }
.tuner-preview-peg.peg-4 { left: 50.5px; top: 56px; }
.tuner-preview-peg.peg-5 { left: 54px; top: 138px; }
.tuner-preview-peg.peg-6 { left: 58px; top: 220px; }

.tuner-preview-peg.peg-4,
.tuner-preview-peg.peg-5,
.tuner-preview-peg.peg-6 {
    background: none;
    padding-left: 0;
    padding-right: 12px;
}

.tuner-preview-peg.peg-4::before,
.tuner-preview-peg.peg-5::before,
.tuner-preview-peg.peg-6::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../assets/assets/svgs/tuner/Tuner_Peg_Default.svg') center / cover no-repeat;
    transform: scaleX(-1);
}

.tuner-preview-tuning {
    position: absolute;
    top: 50px;
    left: calc(50% + 200px);
    width: 261px;
    padding: 20px 16px;
    border-radius: 8px;
    background: #f4f0dd26;
}

.tuner-preview-tuning span {
    display: block;
    font-size: 18px;
    line-height: 1.6;
}

.tuner-preview-tuning .tuner-preview-notes {
    font-size: 14px;
    font-weight: 400;
    opacity: .65;
}

.tuner-loading-status {
    position: absolute;
    top: 490px;
    left: 16px;
    right: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tuner-loading-status p {
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--purple4);
    font-size: 16px;
    line-height: 1.5;
}

.tuner-loading-status button {
    margin-top: 12px;
    padding: 10px 24px;
    border: 0;
    border-radius: 12px;
    background: var(--purple-haze);
    color: var(--white-stripes);
    font: bold 16px 'Basis Grotesque Pro', sans-serif;
    cursor: pointer;
}

.tuner-loading-status button:focus-visible {
    outline: 2px solid var(--white-stripes);
    outline-offset: 4px;
}

@media (max-width: 940px) {
    .tuner-preview-tuning { display: none; }
}

@media (max-width: 349px) {
    .tuner-preview-guitar {
        transform: scale(.85);
        transform-origin: top center;
        left: calc((100% - 350px) / 2);
        margin: 0;
    }
    .tuner-preview-indicator { width: 280px; }
    .tuner-preview-indicator img { width: 280px; }
    .tuner-preview-cents { left: 120px; }
}

@media (prefers-reduced-motion: reduce) {
    .tuner-loading-shell { transition: none; }
}
