/* Akor Rehberim Tuner Styles */

.akor-tuner-wrapper {
    /* max-width: 800px; */
    margin: 0 auto;
    /* padding: 32px 32px; */
    /* background: #f9fbfc; */
    /* border-radius: 18px; */
    color: #222;
    /* box-shadow: 0 6px 32px 0 rgba(57,204,168,0.08), 0 1.5px 6px 0 rgba(0,0,0,0.04); */
    /* transition: box-shadow 0.3s; */
    overflow: visible;
}
/* .akor-tuner-wrapper:hover {
    box-shadow: 0 12px 40px 0 rgba(57,204,168,0.13), 0 2px 8px 0 rgba(0,0,0,0.06);
} */

/* Typography polish */
.current-note {
    font-size: 4.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.08em;
    color: #222;
    text-shadow: 0 2px 8px rgba(57,204,168,0.08);
    transition: color 0.2s, text-shadow 0.2s;
}
.current-frequency {
    font-size: 1.4rem;
    opacity: 0.85;
    font-weight: 400;
    letter-spacing: 0.04em;
}

/* Instrument Presets */
.instrument-presets {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    white-space: nowrap;
}

.instrument-presets::-webkit-scrollbar {
    height: 6px;
}

.instrument-presets::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.instrument-presets::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.preset-btn {
    background: #f4f4f4;
    color: #222;
    border: 1px solid #e0e0e0;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    min-width: max-content;
}
.preset-btn:focus {
    outline: 2px solid #39CCA8;
    outline-offset: 2px;
}
.preset-btn:hover {
    background: #e0e0e0;
    color: #222;
}
.preset-btn.active {
    background: #39CCA8;
    color: #fff;
    border-color: #39CCA8;
    box-shadow: 0 0 0 3px rgba(57,204,168,0.18), 0 2px 8px 0 rgba(57,204,168,0.10);
}
.preset-btn:active {
    background: #2fa488;
    color: #fff;
}
.preset-btn::after {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    background: rgba(57,204,168,0.15);
    border-radius: 100%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, opacity 0.3s;
    opacity: 0;
    z-index: 1;
}
.preset-btn:active::after {
    width: 120%;
    height: 120%;
    opacity: 1;
}

/* String Selection */
.string-selection {
    margin-bottom: 30px;
}

.string-options {
    display: none !important;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    white-space: nowrap;
}

.string-options::-webkit-scrollbar {
    height: 6px;
}

.string-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.string-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.string-options.active {
    display: flex !important;
}

.string-btn {
    background: #f4f4f4;
    color: #222;
    border: 1px solid #e0e0e0;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    min-width: max-content;
}
.string-btn:focus {
    outline: 2px solid #39CCA8;
    outline-offset: 2px;
}
.string-btn:hover {
    background: #e0e0e0;
    color: #222;
}
.string-btn.active {
    background: #39CCA8;
    color: #fff;
    border-color: #39CCA8;
    box-shadow: 0 0 0 2px rgba(57,204,168,0.15);
}
.string-btn:active {
    background: #2fa488;
    color: #fff;
}
.string-btn::after {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    background: rgba(57,204,168,0.12);
    border-radius: 100%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, opacity 0.3s;
    opacity: 0;
    z-index: 1;
}
.string-btn:active::after {
    width: 120%;
    height: 120%;
    opacity: 1;
}

/* Tuner Display */
.tuner-display {
    /* background: #f7fafc; */
    border-radius: 18px;
    padding: 38px 28px;
    margin-bottom: 34px;
    box-shadow: 0 4px 24px 0 rgba(57,204,168,0.07), 0 1.5px 6px 0 rgba(0,0,0,0.04);
    border: 1px solid rgba(57,204,168,0.08);
    transition: box-shadow 0.3s;
}
.tuner-display:hover {
    box-shadow: 0 8px 32px 0 rgba(57,204,168,0.13), 0 2px 8px 0 rgba(0,0,0,0.06);
}

.frequency-display {
    text-align: center;
    margin-bottom: 30px;
}

/* Tuning Feedback */
.tuning-feedback {
    text-align: center;
    margin-top: 20px;
}

.feedback-text {
    font-size: 1.7rem;
    font-weight: 600;
    margin-bottom: 10px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, opacity 0.2s;
    opacity: 1;
}
.feedback-text.fade {
    opacity: 0.3;
    transition: opacity 0.2s;
}

.cents-display {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 300;
}

/* Controls */
.tuner-controls {
    text-align: center;
    /* margin-bottom: 20px; */
}

.control-btn {
    padding: 18px 36px;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(.4,2,.6,1), box-shadow 0.2s;
    /* margin: 0 10px 10px 10px; */
    min-width: 170px;
    box-shadow: 0 2px 8px 0 rgba(57,204,168,0.08);
    position: relative;
    overflow: hidden;
}
.control-btn:focus {
    outline: 2px solid #39CCA8;
    outline-offset: 2px;
}
.control-btn:hover {
    background: #2fa488;
    color: #fff;
}
.control-btn:active {
    background: #2fa488;
    color: #fff;
}
.control-btn.primary {
    background: #39CCA8;
    color: #fff;
    border: none;
}
.control-btn.primary:hover {
    background: #2fa488;
    box-shadow: 0 4px 16px 0 rgba(57,204,168,0.13);
}
.control-btn.secondary {
    background: #ff6b6b;
    color: #fff;
    border: none;
}
.control-btn.secondary:hover {
    background: #d94c4c;
    box-shadow: 0 4px 16px 0 rgba(255,107,107,0.13);
}
.control-btn.primary.full-width,
.control-btn.secondary.full-width {
    width: 100%;
    display: block;
    /* margin: 0 0 18px 0; */
}
.control-btn::after {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.13);
    border-radius: 100%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, opacity 0.3s;
    opacity: 0;
    z-index: 1;
}
.control-btn:active::after {
    width: 120%;
    height: 120%;
    opacity: 1;
}

/* Status Messages */
.status-message {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    font-weight: 500;
    display: none;
}

.status-message.error {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #ffebee;
}

.status-message.success {
    background: rgba(81, 207, 102, 0.2);
    border: 1px solid rgba(81, 207, 102, 0.4);
    color: #e8f5e8;
}

.status-message.info {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #ebf8ff;
}

/* Responsive improvements */
@media (max-width: 768px) {
    /* .akor-tuner-wrapper {
        padding: 12px;
        margin: 8px;
    } */
    .current-note {
        font-size: 2.7rem;
    }
    /* Do not shrink or reduce preset-btn and string-btn on mobile */
    .control-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 90px;
        margin: 5px 0;
    }
    .tuner-display {
        padding: 10px;
    }
}
@media (max-width: 480px) {
    /* .akor-tuner-wrapper {
        padding: 6px;
    } */
    .current-note {
        font-size: 2.2rem;
    }
    .current-frequency {
        font-size: 1.1rem;
    }
    .feedback-text {
        font-size: 1.3rem;
    }
    /* Do not shrink or reduce preset-btn and string-btn on mobile */
    .control-btn {
        padding: 10px 14px;
        font-size: 15px;
        min-width: 80px;
    }
    .cents-display {
        font-size: 1.1rem;
    }
    .tuner-display {
        padding: 6px;
    }
}

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

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
} 

/* Visual Meter Styles */
.tuner-meter {
    position: relative;
    width: 100%;
    height: 260px;
    margin: 32px 0 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
}
.tuner-gradient {
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    z-index: 1;
    background: linear-gradient(90deg, rgba(209,73,91,0.25) 0%, rgba(57,204,168,0.35) 50%, rgba(209,73,91,0.25) 100%);
}
.tuner-grid {
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    border-radius: 10px;
    overflow: hidden;
    background-image: repeating-linear-gradient(to right, rgba(0,0,0,0.07) 0, rgba(0,0,0,0.07) 1px, transparent 1px, transparent 20px),
                      repeating-linear-gradient(to bottom, rgba(0,0,0,0.07) 0, rgba(0,0,0,0.07) 1px, transparent 1px, transparent 20px);
}
.tuner-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    /* The indicator is 46px (outer circle) + 22px (triangle) = 68px. To center the bottom, move up by half of 68px = 34px. */
    transform: translate(-50%, -50%) translateY(-34px);
    transition: left 0.22s cubic-bezier(.4,2,.6,1), box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.tuner-indicator-outer {
    position: relative;
    width: 46px;
    height: 46px;
    background: #222;
    border-radius: 50%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.tuner-indicator-inner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #222;
    font-weight: bold;
    z-index: 2;
}
.tuner-cents {
    font-size: 1.2rem;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.tuner-indicator-outer::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 88%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 22px solid #222;
    z-index: 1;
} 

.tuner-trail {
    position: absolute;
    left: 50%;
    z-index: 0;
    width: 6px;
    top: 50%;
    /* The trail starts at the center, so move up by half the indicator height (68px) */
    height: calc(100% - 50% + 12px); /* from tip to bottom, 12px offset for triangle */
    transform: translateX(-50%) translateY(-12px);
    background: #39CCA8;
    border-radius: 3px;
    pointer-events: none;
    opacity: 0.7;
    transition: left 0.15s cubic-bezier(.4,2,.6,1);
} 

.tuner-trail-segment {
    position: absolute;
    width: 6px;
    border-radius: 3px;
    background: #39CCA8;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
    transition: opacity 0.3s linear;
} 

.tuner-path-trail {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 50%;
    pointer-events: none;
    z-index: 0;
}

/* Perfect Tune Indicator Bar */
.perfect-tune-indicator {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.perfect-tune-bar {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    background: linear-gradient(90deg, #39CCA8 0%, #2fa488 100%);
    border-radius: 10px;
    transform: translateX(-50%);
    width: 0;
    transition: width 0.35s cubic-bezier(.4,2,.6,1), background 0.2s;
} 

/* Indicator Glow when close to perfect */
.tuner-indicator[data-glow='true'] .tuner-indicator-outer {
    box-shadow: 0 0 24px 6px #39CCA8, 0 0 0 4px #fff;
    transition: box-shadow 0.2s;
} 

@keyframes perfectTunePop {
    0% { box-shadow: 0 0 0 0 #39CCA8, 0 0 0 0 #fff; transform: scale(1); }
    40% { box-shadow: 0 0 32px 8px #39CCA8, 0 0 0 4px #fff; transform: scale(1.08); }
    80% { box-shadow: 0 0 16px 4px #39CCA8, 0 0 0 2px #fff; transform: scale(1.03); }
    100% { box-shadow: 0 0 0 0 #39CCA8, 0 0 0 0 #fff; transform: scale(1); }
}
@keyframes perfectTuneBarGlow {
    0% { box-shadow: 0 0 0 0 #39CCA8; }
    40% { box-shadow: 0 0 32px 8px #39CCA8; }
    80% { box-shadow: 0 0 16px 4px #39CCA8; }
    100% { box-shadow: 0 0 0 0 #39CCA8; }
}
.tuner-indicator.perfect-tune-visual .tuner-indicator-outer {
    animation: perfectTunePop 0.5s cubic-bezier(.4,2,.6,1);
    z-index: 10;
}
.perfect-tune-bar.perfect-tune-visual {
    animation: perfectTuneBarGlow 0.5s cubic-bezier(.4,2,.6,1);
    z-index: 10;
} 