/* Tempo Calculator Styles */

/* Tool Container */
.ctf-tool {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

.ctf-tool__container {
    max-width: 800px;
    margin: 0 auto;
}

/* Tool Title (H2 only) */
.ctf-tool__title {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 32px;
    text-align: center;
    line-height: 1.2;
}

.ctf-tool__section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Section Labels (not headings) */
.ctf-section-label {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 20px;
    line-height: 1.4;
}

/* Tap Tempo Section */
.ctf-tap-section {
    text-align: center;
}

.ctf-tap-display {
    margin-bottom: 32px;
}

.ctf-bpm-value {
    font-size: 72px;
    font-weight: 700;
    color: #999;
    line-height: 1;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.ctf-bpm-value.ctf-bpm-active {
    color: #2563eb;
}

.ctf-bpm-label {
    font-size: 18px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.ctf-tap-count {
    font-size: 14px;
    color: #666;
    min-height: 21px;
}

/* Buttons */
.ctf-tool__button {
    display: inline-block;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ctf-tool__button:focus {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

.ctf-tool__button--primary {
    background: #2563eb;
    color: #fff;
    padding: 24px 48px;
    font-size: 24px;
    margin: 0 8px 16px;
    min-width: 280px;
}

.ctf-tool__button--primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.ctf-tool__button--primary:active,
.ctf-tool__button--primary.ctf-tap-active {
    background: #1e40af;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.ctf-tool__button--secondary {
    background: #f3f4f6;
    color: #374151;
    padding: 12px 24px;
    font-size: 14px;
    margin: 0 8px;
}

.ctf-tool__button--secondary:hover {
    background: #e5e7eb;
}

.ctf-tool__button--secondary:active {
    background: #d1d5db;
}

.ctf-tool__hint {
    margin-top: 16px;
    font-size: 14px;
    color: #6b7280;
}

/* Manual Input Section */
.ctf-manual-section {
    text-align: center;
}

.ctf-section-title {
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 24px;
    line-height: 1.3;
}

.ctf-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ctf-tool__label {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
}

.ctf-tool__input {
    width: 120px;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.ctf-tool__input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Note Duration Section */
.ctf-note-duration-section {
}

.ctf-note-table {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.ctf-note-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.ctf-note-row:last-child {
    border-bottom: none;
}

.ctf-note-header {
    background: #f9fafb;
    font-weight: 600;
    color: #1f2937;
}

.ctf-note-name {
    text-align: left;
}

.ctf-note-duration {
    text-align: right;
    font-weight: 500;
    color: #2563eb;
}

/* Tempo Marking Section */
.ctf-tempo-table {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.ctf-tempo-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.5fr;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
}

.ctf-tempo-row:last-child {
    border-bottom: none;
}

.ctf-tempo-header {
    background: #f9fafb;
    font-weight: 600;
    color: #1f2937;
}

.ctf-tempo-marking {
    text-align: left;
    font-weight: 500;
}

.ctf-tempo-bpm {
    text-align: center;
    font-weight: 500;
    color: #2563eb;
}

.ctf-tempo-description {
    text-align: left;
    color: #6b7280;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ctf-tool__title {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .ctf-tool__section {
        padding: 20px 16px;
        margin-bottom: 16px;
        border-radius: 6px;
    }

    .ctf-bpm-value {
        font-size: 56px;
    }

    .ctf-tool__button--primary {
        min-width: 100%;
        font-size: 20px;
        padding: 20px 32px;
    }

    .ctf-tempo-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 16px;
    }

    .ctf-tempo-marking,
    .ctf-tempo-bpm,
    .ctf-tempo-description {
        text-align: left;
    }

    .ctf-tempo-marking {
        font-weight: 600;
        font-size: 16px;
    }

    .ctf-tempo-bpm {
        font-size: 14px;
    }

    .ctf-tempo-description {
        font-size: 14px;
        padding-bottom: 8px;
    }

    .ctf-note-row {
        gap: 8px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .ctf-bpm-value {
        font-size: 48px;
    }

    .ctf-tool__button--primary {
        font-size: 18px;
        padding: 18px 24px;
    }

    .ctf-section-title {
        font-size: 18px;
    }
}

/* Accessibility - High Contrast Focus */
@media (prefers-contrast: high) {
    .ctf-tool__button:focus {
        outline: 4px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ctf-tool__button,
    .ctf-bpm-value {
        transition: none;
    }
}

/* Touch Target Improvements */
@media (pointer: coarse) {
    .ctf-tool__button--primary {
        min-height: 64px;
    }

    .ctf-tool__button--secondary {
        min-height: 48px;
    }
}
