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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    transition: padding-top 0.3s ease-out;
    padding-top: 0;
}

body.offline-mode {
    padding-top: 40px;
}

.container {
    max-width: 100%;
    padding: 1rem;
    margin: 0 auto;
    transition: margin-top 0.3s ease-out;
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: #7f8c8d;
    text-align: center;
    /* margin-bottom: 1.5rem; */
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Header */
header {
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

/* Tuning selector */
.tuning-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.tuning-dropdown {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border: 2px solid #3498db;
    background-color: white;
    color: #2c3e50;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233498db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.tuning-dropdown:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.tuning-dropdown option {
    padding: 0.5rem;
}

/* Tuner display */
.tuner-container {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.tuner-display {
    text-align: center;
    margin-bottom: 1.5rem;
}

.note-display {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.frequency-display {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.tuning-indicator {
    position: relative;
    height: 60px;
    margin: 0 auto;
    width: 80%;
    max-width: 300px;
}

.indicator-bar {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #ecf0f1;
    transform: translateY(-50%);
    border-radius: 2px;
}

.indicator-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 20px;
    background-color: #2ecc71;
    transform: translate(-50%, -50%);
    border-radius: 2px;
}

.indicator-needle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background-color: #e74c3c;
    transform: translateX(-50%);
    transition: left 0.2s ease;
}

.indicator-needle.fast-transition {
    transition: left 0.1s ease;
}

.indicator-needle.slow-transition {
    transition: left 1s ease-out;
}

/* String selector */
.string-selector {
    margin-bottom: 1.5rem;
    position: relative;
    background-color: #f9f3e5;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    border: 1px solid #e6d7b8;
}

.instrument-neck {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.string-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.string-line {
    flex-grow: 1;
    height: 2px;
    background-color: #a0a0a0;
    position: relative;
    border-radius: 1px;
}

.string-line.string-1 {
    height: 1px;
    background-color: #d0d0d0;
}

.string-line.string-2 {
    height: 2px;
    background-color: #b0b0b0;
}

.string-line.string-3 {
    height: 3px;
    background-color: #909090;
}

.string-line.string-4 {
    height: 4px;
    background-color: #707070;
}

.string-line.string-5 {
    height: 5px;
    background-color: #505050;
}

.string-line.string-6 {
    height: 6px;
    background-color: #303030;
}

.string-btn {
    padding: 0.5rem;
    min-width: 60px;
    border: 1px solid #bdc3c7;
    background-color: white;
    color: #34495e;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
}

.string-btn.active {
    border-color: #3498db;
    background-color: #ebf5fb;
    color: #3498db;
}

.string-note {
    min-width: 60px;
    text-align: center;
    font-weight: 600;
    color: #34495e;
    font-size: 0.85rem;
    line-height: 1.2;
}

/* Button container */
.button-container {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.primary-btn {
    flex: 1;
    padding: 1rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.primary-btn:hover {
    background-color: #2980b9;
}

.primary-btn.listening {
    background-color: #e74c3c;
}

.secondary-btn {
    flex: 1;
    padding: 1rem;
    background-color: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background-color: #e0e6e8;
}

.secondary-btn.active {
    background-color: #2ecc71;
    color: white;
    border-color: #27ae60;
}

/* Instructions */
.instructions {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.instructions ol {
    padding-left: 1.5rem;
}

.instructions li {
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Neck Visualizer */
.neck-visualizer-container {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.neck-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.fretboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

.neck-string {
    display: flex;
    height: 40px;
    position: relative;
    align-items: center;
}

.neck-string::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #a0a0a0;
    z-index: 1;
}

.neck-string-1::before {
    height: 1px;
    background-color: #d0d0d0;
}

.neck-string-2::before {
    height: 1.5px;
    background-color: #b0b0b0;
}

.neck-string-3::before {
    height: 2px;
    background-color: #909090;
}

.neck-string-4::before {
    height: 2.5px;
    background-color: #707070;
}

.neck-string-5::before {
    height: 3px;
    background-color: #505050;
}

.neck-string-6::before {
    height: 3.5px;
    background-color: #303030;
}

.fret {
    flex: 1;
    height: 100%;
    border-right: 2px solid #a0a0a0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.fret:first-child {
    border-left: 4px solid #34495e;
    flex: 0.5;
}

.fret-marker::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #bdc3c7;
    border-radius: 50%;
    z-index: 1;
}

.fret.highlight {
    background-color: rgba(52, 152, 219, 0.3);
    transition: background-color 0.2s ease-in;
}

.fret.exact-match {
    background-color: rgba(46, 204, 113, 0.5);
    transition: background-color 0.2s ease-in;
}

.fret.highlight.fading {
    background-color: rgba(52, 152, 219, 0.1);
    transition: background-color 1s ease-out;
}

.fret.exact-match.fading {
    background-color: rgba(46, 204, 113, 0.2);
    transition: background-color 1s ease-out;
}

.fret.highlight::after,
.fret.exact-match::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #3498db;
    border-radius: 50%;
    z-index: 3;
    transition: opacity 0.2s ease-in, background-color 0.2s ease-in, width 0.2s ease-in, height 0.2s ease-in;
}

.fret.exact-match::after {
    background-color: #2ecc71;
    width: 20px;
    height: 20px;
}

.fret.highlight.fading::after,
.fret.exact-match.fading::after {
    opacity: 0.5;
    transition: opacity 1s ease-out, background-color 1s ease-out;
}

.visualizer-controls {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.visualizer-controls label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.range-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.range-container input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ecf0f1;
    outline: none;
}

.range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    transition: background 0.2s;
}

.range-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    transition: background 0.2s;
}

.range-container input[type="range"]::-webkit-slider-thumb:hover,
.range-container input[type="range"]::-moz-range-thumb:hover {
    background: #2980b9;
}

.range-container span {
    min-width: 30px;
    text-align: center;
    font-weight: 500;
    color: #7f8c8d;
}

/* Media queries for larger screens */
@media (min-width: 768px) {
    .container {
        max-width: 700px;
        padding: 2rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .neck-string {
        height: 50px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 800px;
    }

    .neck-string {
        height: 60px;
    }
} 

/* Offline notification */
.offline-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #f44336;
    color: white;
    text-align: center;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 10px;
}

.offline-alert.visible {
    transform: translateY(0);
}

/* Push down the container when offline alert is visible */
body.offline-mode .container {
    margin-top: 40px;
}