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

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #ffffff;
    user-select: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Navigation Bar Styles */
.navbar {
    background-color: #ffffff;
    padding: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid #00000010;
    height: 4rem; /* 64px for desktop */
}

.nav-content {
    max-width: 1600px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #000000;
    text-decoration: none;
    height: 100%;
}

.brand-logo {
    width: 2.5rem; /* 40px */
    height: 2.5rem; /* 40px */
    object-fit: contain;
}

.nav-brand span {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: #ffffff80;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #000000;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .navbar {
        height: 3.5rem; /* 56px for mobile */
    }

    .brand-logo {
        width: 2rem; /* 32px */
        height: 2rem; /* 32px */
    }

    .nav-brand span {
        font-size: 1.25rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.875rem;
    }
}

/* Description Section Styles */
.description {
    max-width: 900px;
    margin: 0 auto 3rem;
    padding: 0 1.5rem;
}

.description h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #000;
    line-height: 1.2;
}

.description h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 2.5rem 0 1.5rem;
    color: #000;
}

.description h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
    color: #000;
}

.description p {
    margin-bottom: 1.5rem;
    color: #444;
    line-height: 1.7;
}

.description strong {
    color: #000;
    font-weight: 600;
}

.what-is,
.how-to-use,
.faq,
.conclusion {
    margin: 3rem 0;
}

.how-to-use ol {
    padding-left: 1.5rem;
    margin: 1.5rem 0;
}

.how-to-use li {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    color: #444;
}

.faq-item {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.faq-item h3 {
    margin-top: 0;
    color: #000;
}

.faq-item p {
    margin-bottom: 0;
}

.conclusion {
    background: #f0f9f0;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid rgba(22, 255, 1, 0.1);
}

@media (max-width: 768px) {
    .description h1 {
        font-size: 2rem;
    }

    .description h2 {
        font-size: 1.5rem;
    }

    .description h3 {
        font-size: 1.2rem;
    }

    .faq-item {
        padding: 1.25rem;
    }

    .conclusion {
        padding: 1.5rem;
    }
}

.description .intro {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.description .features ul {
    list-style: none;
    margin: 1rem 0;
}

.description .features li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.description .features li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #000;
}

.description .features strong {
    color: #000;
}

.description .expand-skills,
.description .more-info {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

/* Main Content Styles */
.container {
    width: 100%;
    max-width: 1600px;
    padding: 0;
    margin: 3rem auto 2rem;
    flex: 1;
}

/* Piano Styles */
.piano {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 0.5rem;
    background-color: #000000;
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 4px 0.1rem rgba(0,0,0,0.2);
    touch-action: none; /* Disable scrolling only on piano keys */
}

/* Footer Styles */
.footer {
    background-color: #f9f9f9;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid #00000010;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-section p {
    margin: 0;
    max-width: 600px;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #16FF01;
}

@media (max-width: 768px) {
    .footer-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-links {
        justify-content: center;
    }
}

/* Piano container using CSS Grid */
.piano {
    display: grid;
    /* Default: 2 columns (for mobile sizes) */
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 0.5rem;
    background-color: #000000;
    width: 100%;
}

/* Media query for larger screens: 4 columns in one row */
@media screen and (min-width: 1024px) {
    .piano {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Each octave container */
.octave {
    position: relative;
    display: flex;
    justify-content: flex-start; /* Align keys to start for consistent spacing */
    background: none;
    padding: 0;
    width: 100%;
}

/* Common styles for all keys */
.key {
    position: relative;
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    margin: 0;
    font-size: 0.55rem;
    user-select: none;
    cursor: pointer;
    padding-bottom: 8px;
    color: #00000050;
    transition: background-color 0.1s ease;
}

/* White key style */
.white-key {
    width: calc(100% / 7); /* 7 white keys per octave */
    height: 160px;
    background: #fff;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    border-left: 0;
    border-top: 1px solid #000;
    border-radius: 0 0 0.25rem 0.25rem;
}

/* Remove left border for first white key in octave */
.octave .white-key:first-child {
    border-left: 1px solid #000000;
}

/* Black key style */
.black-key {
    position: absolute;
    width: calc(100% / 12); /* Standard width ratio for black keys */
    height: 90px;
    background: #000;
    color: #ffffffb1;
    z-index: 2;
    border-radius: 0 0 0.25rem 0.25rem;
    box-shadow: 0 4px 0.1rem rgba(0,0,0,0.2);
}

/* Position black keys using precise calculations */
/* Each white key is 14.285714% (100/7) wide */
/* Black keys are positioned relative to this width */
.octave .black-key:nth-of-type(2) { left: calc((100% / 7) - ((100% / 12) / 2)); } /* C# */
.octave .black-key:nth-of-type(4) { left: calc((100% / 7 * 2) - ((100% / 12) / 2)); } /* D# */
.octave .black-key:nth-of-type(7) { left: calc((100% / 7 * 4) - ((100% / 12) / 2)); } /* F# */
.octave .black-key:nth-of-type(9) { left: calc((100% / 7 * 5) - ((100% / 12) / 2)); } /* G# */
.octave .black-key:nth-of-type(11) { left: calc((100% / 7 * 6) - ((100% / 12) / 2)); } /* A# */

/* Active states */
.key.active {
    background-color: #16FF01;
}

.key.black-key.active {
    background-color: #16FF01;
    border-color: #000000;
}

/* Mobile optimizations */
@media (max-width: 1024px) {
    .white-key {
        height: 140px;
        font-size: 10px;
    }
    
    .black-key {
        height: 80px;
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .white-key {
        height: 120px;
        font-size: 8px;
    }
    
    .black-key {
        height: 70px;
        font-size: 6px;
    }
}

.piano-container {
    position: relative;
    width: 100%;
    margin: 1rem auto 1rem;
    touch-action: pan-x pan-y; /* Enable scrolling */
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.preset-select,
.reverb-select,
.note-names-toggle {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    background-color: #fff;
    border: 1px solid #00000020;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    min-width: 150px;
    width: 100%;
    max-width: 200px;
}

.preset-select:hover,
.reverb-select:hover {
    background-color: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preset-select:focus,
.reverb-select:focus {
    border-color: #0fcc01;
    box-shadow: 0 0 0 2px rgba(22, 255, 1, 0.2);
}

.note-names-toggle:hover {
    background-color: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.note-names-toggle:focus {
    border-color: #0fcc01;
    box-shadow: 0 0 0 2px rgba(22, 255, 1, 0.2);
}

.key.notes-hidden {
    color: transparent;
}

.sound-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
    min-height: 300px; /* Ensure minimum height for loader visibility */
}

.sound-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #16FF01;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loader-text {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.loader-progress {
    font-size: 1rem;
    color: #666;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.share-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.share-text {
    font-size: 1rem;
    color: #333;
    margin: 0;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #00000010;
    transition: all 0.2s ease;
    cursor: pointer;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #16FF01;
}

.share-button img {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.share-button:hover img {
    transform: scale(1.1);
}

@media (max-width: 480px) {
    .share-button {
        width: 36px;
        height: 36px;
    }

    .share-button img {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem 0.5rem;
    }

    .preset-select,
    .reverb-select,
    .note-names-toggle {
        width: 100%;
        max-width: 100%;
        font-size: 0.9rem;
        padding: 0.75rem;
    }
} 