/* Rhythm Machine Styles */

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

body {
    font-family: 'Helvetica', 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: bold;
    letter-spacing: 2px;
}

h2 {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

h3 {
    font-size: 14px;
    font-weight: bold;
    margin: 0;
}

.section {
    margin-bottom: 20px;
}

/* Form Groups */
.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.form-group label {
    flex: 0 0 200px;
    text-align: right;
    font-size: 14px;
}

.form-group input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.info-text {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin: 15px 0;
    line-height: 1.5;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.8;
}

.btn-primary {
    background-color: #4a90e2;
    color: white;
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.btn-secondary {
    background-color: #4a90e2;
    color: white;
}

.btn-randomize {
    background-color: #d946ef;
    color: white;
}

.btn-play {
    background-color: #22c55e;
    color: white;
    font-size: 18px;
}

.btn-stop {
    background-color: #ef4444;
    color: white;
    font-size: 18px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-toggle {
    flex: 1;
    margin: 0 5px;
}

.btn-order {
    background-color: #22c55e;
    color: white;
}

.btn-order.rest-first {
    background-color: #eab308;
    color: black;
}

.btn-class {
    background-color: #4a90e2;
    color: white;
}

.btn-class.class-b {
    background-color: #06b6d4;
    color: white;
}

/* Header Info */
.header-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.cycle-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cycle-control label {
    font-size: 12px;
    font-weight: bold;
}

.cycle-control input {
    width: 70px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
}

.cycle-control span {
    font-size: 12px;
}

.info-display {
    font-size: 11px;
    color: #666;
}

/* Blocks Container */
.blocks-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fafafa;
    border-radius: 4px;
}

.block-control {
    background-color: white;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.block-header {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
    background-color: #e5e5e5;
    padding: 4px 8px;
    border-radius: 3px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-row label {
    font-size: 12px;
    min-width: 50px;
    text-align: right;
}

.number-input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
}

.slider {
    flex: 1;
    min-width: 150px;
}

/* Markers Section */
.markers-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.markers-section > label:first-child {
    font-size: 13px;
    font-weight: bold;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

/* B Parameters Section */
.b-params-section {
    background-color: #f0f9ff;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #bae6fd;
}

.b-params-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.param-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.param-row label {
    font-size: 11px;
    min-width: 50px;
}

.param-row label:first-child {
    font-weight: bold;
    min-width: 60px;
}

.param-row input,
.param-row select {
    padding: 3px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 11px;
}

.param-row input[type="number"] {
    width: 60px;
}

.param-row select {
    width: 90px;
}

.param-sub {
    padding-left: 60px;
}

.param-sub label:first-child {
    color: #999;
    font-style: italic;
    font-weight: normal;
}

.hint {
    font-size: 9px;
    color: #666;
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.action-buttons .btn {
    flex: 1;
    padding: 12px;
    font-size: 15px;
}

/* Playback Buttons */
.playback-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.playback-buttons .btn {
    flex: 1;
    padding: 15px;
}

/* Status Text */
.status-text {
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    padding: 8px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.status-text.valid {
    background-color: #d1fae5;
    color: #065f46;
}

.status-text.invalid {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Pattern Display */
.pattern-display {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.5;
}

/* Notation Display (Verovio) */
#notation-display {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    min-height: 120px;
}

#notation-display svg {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

#notation-display p {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 0;
    padding: 20px;
}

/* Scrollbar Styling */
.blocks-container::-webkit-scrollbar,
.pattern-display::-webkit-scrollbar {
    width: 8px;
}

.blocks-container::-webkit-scrollbar-track,
.pattern-display::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.blocks-container::-webkit-scrollbar-thumb,
.pattern-display::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.blocks-container::-webkit-scrollbar-thumb:hover,
.pattern-display::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .container {
        padding: 15px;
    }
    
    .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group label {
        text-align: left;
        flex: none;
    }
    
    .header-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .param-row {
        font-size: 10px;
    }
}
