:root {
    --drums-color: 63, 58, 255;    /* #3F3AFF in RGB */
    --perc-color: 58, 255, 133;    /* #3AFF85 in RGB */
    --bass-color: 244, 58, 255;    /* #F43AFF in RGB */
    --chords-color: 255, 58, 93;   /* #FF3A5D in RGB */
    --lead-color: 255, 253, 5;     /* #FFFD05 in RGB */
    --stop-color: 76, 175, 80;     /* #4CAF50 */
    --mute-color: 255, 68, 68;     /* #ff4444 */
    --delay1-color: 156, 39, 176;  /* #9c27b0 */
    --delay2-color: 103, 58, 183;  /* #673ab7 */
    --mobile-width: 480px;
    --tablet-width: 768px;
    --desktop-width: 1024px;
    --navbar-height: 60px;
    --transport-height: 80px;
}

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

body {
    font-family: 'Arial', sans-serif;
    color: #fff;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: radial-gradient(circle at center, #000000 0%, #000000 50%, #131422 100%);
}

.container {
    position: relative;
    z-index: 2;
    padding: none;
    width: 100%;
    min-height: calc(100vh - var(--navbar-height));
    margin: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.loops-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
    padding: 0.5rem;
    margin: none;
    width: min(
        calc(100vw - 2rem),
        min(
            calc((100vh - var(--navbar-height) - var(--transport-height) - 4rem) * 4/5),
            800px
        )
    );
    aspect-ratio: 4/5;
    align-self: center;
}

.loop-button {
    height: 100%;
    min-height: 0;
    font-size: 0.7rem;
    padding: 0.2rem;
    border-radius: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: rgba(var(--button-color, 21, 255, 0), 0.2);
    border: 2px solid rgba(var(--button-color, 21, 255, 0), 0.5);
    color: rgb(var(--button-color, 21, 255, 0));
    transform: scale(1);
    transition: all 0.1s ease;
    aspect-ratio: 1/1;
    width: 100%;
}

.loop-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    background: rgba(var(--button-color, 21, 255, 0), 0.7);
}

.loop-button.active {
    background: rgba(var(--button-color, 21, 255, 0), 0.95);
    border: 2px solid white;
    border-color: white;
    color: white;
}

.loop-button[data-category="drums"] {
    --button-color: var(--drums-color);
}

.loop-button[data-category="perc"] {
    --button-color: var(--perc-color);
}

.loop-button[data-category="bass"] {
    --button-color: var(--bass-color);
}

.loop-button[data-category="chords"] {
    --button-color: var(--chords-color);
}

.loop-button[data-category="lead"] {
    --button-color: var(--lead-color);
}

.transport {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: none;
    gap: 0.5rem;
    padding: 0 0.5rem;
    flex-shrink: 0;
}

.transport button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.4rem;
    font-size: 0.6rem;
    border: none;
    color: #fff;
    padding: none;
    cursor: pointer;
    background: rgb(var(--button-color, var(--stop-color)));
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transport button:hover {
    transform: translateY(-2px);
}

#stopButton {
    background-color: #ffffff10;
    border: 1px solid #ffffff10;
}

#muteButton {
    background-color: #ffffff10;
    border: 1px solid #ffffff10;
}

#delayButton {
    background-color: #ffffff10;
    border: 1px solid #ffffff10;
}

#delayButton2 {
    background-color: #ffffff10;
    border: 1px solid #ffffff10;
}

.navbar {
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    padding: none;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.navbar h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 100;
    color: white;
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.1;
    z-index: 1;
}

.loop-button.loading {
    background: linear-gradient(90deg, 
        rgba(var(--button-color), 0.1) 0%,
        rgba(var(--button-color), 0.2) 50%,
        rgba(var(--button-color), 0.1) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    pointer-events: none;
    opacity: 0.7;
}

.loop-button:disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.loop-button.error {
    background: rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.5);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.loop-button.keyboard-pressed {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.key-label {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 0.6rem;
    padding: 1px 3px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-family: monospace;
    pointer-events: none;
    opacity: 0.8;
}

.loop-button:hover .key-label,
.loop-button.active .key-label,
.loop-button.loading .key-label {
    opacity: 1;
}

#recordButton {
    --button-color: 255, 0, 0;
    border-radius: 2rem;
}

#recordButton.active {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        background: rgba(255, 0, 0, 0.8);
    }
    50% {
        background: rgba(255, 0, 0, 0.4);
    }
    100% {
        background: rgba(255, 0, 0, 0.8);
    }
}

.navbar-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.nav-logo {
    width: 1.5rem;
    height: 1.5rem;
}

.navbar p {
    font-size: 0.9rem;
}

.transport button img {
    width: 1rem;
    height: 1rem;
}

#recordButton {
    --button-color: 255, 0, 0;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#recordButton img {
    width: 1.2rem;
    height: 1.2rem;
    transition: all 0.3s ease;
}

#recordButton.active {
    animation: pulse 1.5s infinite;
}

#recordButton.active img {
    opacity: 0.8;
}

#stopButton {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#stopButton img {
    width: 1rem;
    height: 1rem;
}

/* Content wrapper styles */
.content-wrapper {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.content-wrapper h1 {
    font-size: 2rem;
    font-weight: 300;
    text-align: center;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, #fff, #aaa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.content-wrapper > p {
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.info-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.info-section h2 {
    font-size: 1.4rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-section h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.4rem;
    background: linear-gradient(to bottom, #3F3AFF, #F43AFF);
    border-radius: 2px;
}

.info-section p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
}

/* Download button styles */
.download-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    margin-left: auto;
}

.download-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.download-button img {
    width: 1.2rem;
    height: 1.2rem;
}

/* Media Queries */
@media (min-width: 768px) {
    .container {
        padding: none;
        height: calc(100vh - 140px);
    }

    .navbar-content {
        gap: 1rem;
        padding: 0.8rem;
    }

    .nav-logo {
        width: 2rem;
        height: 2rem;
    }

    .navbar p {
        font-size: 1rem;
    }

    .transport {
        gap: 0.8rem;
        margin: none;
    }

    .transport button {
        width: 3rem;
        height: 3rem;
        font-size: 0.7rem;
    }

    .loops-grid {
        gap: 0.5rem;
        padding: 0.8rem;
    }

    .loop-button {
        font-size: 0.8rem;
        padding: 0.3rem;
    }

    .key-label {
        font-size: 0.7rem;
        padding: 2px 4px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: none;
        height: calc(100vh - 160px);
    }

    .navbar-content {
        gap: 1.5rem;
        padding: 1rem;
    }

    .transport {
        gap: 1rem;
        margin: none;
    }

    .loops-grid {
        gap: 0.8rem;
        padding: 1rem;
    }

    .loop-button {
        font-size: 0.9rem;
        padding: 0.4rem;
    }
}

@media (hover: none) {
    .loop-button:hover {
        transform: none;
        box-shadow: none;
    }

    .transport button:hover {
        transform: none;
    }

    .loop-button:active {
        transform: scale(0.95);
    }

    .transport button:active {
        transform: scale(0.95);
    }
}

button {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@media (max-height: 500px) and (orientation: landscape) {
    .container {
        justify-content: center;
        min-height: calc(100vh - var(--navbar-height));
        padding: none;
    }
    
    .loops-grid {
        width: min(
            calc(100vw - 80px - 2rem),
            calc((100vh - var(--navbar-height) - 2rem) * 4/5)
        );
    }
}

@media (max-width: 768px) {
    .download-button span {
        display: none;
    }
    
    .download-button {
        padding: 0.5rem;
    }

    .content-wrapper {
        margin: 1rem auto;
    }

    .content-wrapper h1 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    .content-wrapper > p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .info-section {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .info-section h2 {
        font-size: 1.2rem;
    }

    .info-section p {
        font-size: 0.85rem;
        line-height: 1.6;
    }
}

/* Add these footer styles at the end of your CSS file */
.footer {
    margin-top: 4rem;
    padding: 2rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.footer-logo img {
    width: 2rem;
    height: 2rem;
}

.footer-logo span {
    font-size: 1.2rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
}

.footer-download-button {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.footer-download-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.footer-download-button img {
    width: 1.4rem;
    height: 1.4rem;
}

/* Add these to your existing media queries */
@media (max-width: 768px) {
    .footer {
        margin-top: 2rem;
        padding: 1.5rem 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

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

    .footer-download-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }

    .footer-download-button img {
        width: 1.2rem;
        height: 1.2rem;
    }

    .footer-rating {
        order: 3; /* Move rating to bottom on mobile */
    }
}

/* Add these to your footer styles */
.footer-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.stars {
    display: flex;
    gap: 0.2rem;
}

.star {
    color: #FFD700;
    font-size: 1.2rem;
    line-height: 1;
}

.star.half {
    position: relative;
    display: inline-block;
    background: linear-gradient(90deg, #FFD700 50%, rgba(255, 215, 0, 0.3) 50%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rating-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}