@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap');

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f9f9f9;
    font-size: 16px;
    margin: 0;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff; /* Optional: Set a background color */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Optional: Add a shadow for better visibility */
}

#sections {
    display: flex;
    flex-direction: row; /* Change to row to place sections side by side */
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping to the next line if necessary */
}

.all-bars {
    display: flex;
    flex-direction: row;
    gap: 5px;
    flex-wrap: wrap;
}

button {
    /* disable zoom caused by double tapping on phone */
    touch-action: manipulation;
}

.controls button {
    background-color: #4CAF50; /* Green background */
    border: none; /* Remove borders */
    color: white; /* White text */
    /*padding: 10px 20px; !* Some padding *!*/
    text-align: center; /* Centered text */
    text-decoration: none; /* Remove underline */
    display: inline-block; /* Make the buttons appear side by side */
    font-size: 12px; /* Increase font size */
    margin: 4px 2px; /* Some margin */
    cursor: pointer; /* Pointer/hand icon */
    border-radius: 8px; /* Rounded corners */
    transition: background-color 0.3s; /* Smooth transition for background color */
    width: 30px; /* Set a fixed width */
    height: 30px; /* Set a fixed height */
}

.controls button i {
    margin: 0;
    padding: 0;
}

.action-button:hover  {
    background-color: #45a049; /* Darker green on hover */
}

.controls .hidden {
    display: none;
}

button:disabled {
    /*background-color: #cccccc; !* Gray background for disabled state *!*/
    /*cursor: not-allowed; !* Not-allowed cursor for disabled state *!*/
}

.section {
    position: relative;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}


.section-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f0f0f0;
    padding: 5px 10px 5px 5px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 1px solid #e0e0e0;
    color: #333333;
}

.action-button {
    margin-right: 10px; /* Adjust the spacing as needed */
    cursor: pointer;
    border-radius: 4px; /* Add border radius */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Softer shadow */
    padding: 3px; /* Reduce padding */
    width: 15px; /* Smaller width */
    height: 15px; /* Smaller height */
    display: flex; /* Center the icon */
    align-items: center; /* Center the icon */
    justify-content: center; /* Center the icon */
    background-color: #4CAF50;
    color: #FFFFFF;
    font-size: 14px;
}

.action-button:hover {
    background-color: #388E3C;
}

.remove-section-icon {
    background-color: #F44336;
    margin-right: 0; /* rely on the existing padding for the last button*/
}

.remove-section-icon:hover {
    background-color: #D32F2F; /* Darker background on hover */
}

.section-top-bar .duplicate-section-icon i,
.section-top-bar .remove-section-icon i {
    font-size: 14px; /* Smaller icon size */
}

.section-label {
    font-size: 14px;
    color: #333333;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    margin-right: auto; /* Pushes the label to the left */
    background-color: #E0E0E0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    padding: 3px;
    text-align: center;
}

.section input, .section select {
    width: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.blink {
    animation: blink 1s steps(1, end) infinite;
}

#add-section:hover, #start-pause:hover {
    background-color: #45a049;
}

.bar-container {
    display: flex;
    align-items: start;
    justify-content: center;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden; /* Prevent content from overflowing */
}

.bar-info {
    display: block;
    width: 100%;
    align-items: center;
    justify-content: start;
    /*background-color: #f0f0f0; !* Different background color *!*/
    /*padding-left: 5px;*/
    font-size: 11px;
    color: grey;
    /*border-radius: 5px;*/
    /*margin-left: 5px;*/
    /*margin-right: 10px;*/
}

/*.bar-number {*/
/*    font-weight: 400;*/
/*    font-size: 10pt;*/
/*    color: #777777FF;*/
/*    position: absolute; !* Position absolutely within the bar container *!*/
/*    top: 5px; !* Adjust as needed *!*/
/*    left: 5px; !* Adjust as needed *!*/
/*}*/

.bar {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    margin-bottom: 5px;
    margin-right: 5px;
}

.section-beats {
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.beat {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.beat:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.beat.on {
    color: black;
}

.beat.accented {
    /*background-color: #ffeb3b;*/
    color: red;
    font-style: italic;
}

.beat.silent {
    text-decoration: line-through; /* Add strikethrough */
}

#playback-view .beat {
}

#playback-view .beat.active {
    /*box-shadow: none;*/
    opacity: 1;
    background-color: #35a392;
    font-weight: bold;
}

.separator {
    height: 1px;
    background-color: #ddd;
    margin: 20px 0;
}

.bpm-display {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.beats-counter-display {
    position: absolute;
    right: 120px;
    top: 20px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.range-controls {
    display: flex;
    align-items: center;
    /*gap: 5px;*/
}

/*.beats-controls button, .bars-controls button {*/
/*    width: 20px;*/
/*    height: 20px;*/
/*    display: flex;*/
/*    align-items: center;*/
/*    justify-content: center;*/
/*    border: 1px solid #ddd;*/
/*    border-radius: 4px;*/
/*    background-color: white;*/
/*    cursor: pointer;*/
/*}*/

.beats-controls .beats-value, .bars-controls .bars-value {
    width: 20px;
    text-align: center;
}

.setup-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    /*background-color: rgba(35, 31, 31, 0.82);*/
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    position: relative;
}

.bars-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    /*background-color: rgba(35, 31, 31, 0.82);*/
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.view-header {
    font-family: 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: bold;
    color: black;
    text-align: left;
    max-width: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.view-header span {
    border-bottom: 4px solid #f0f0f0;
}
/*.controls {*/
/*    display: flex;*/
/*    align-items: center; !* Vertically align items in the center *!*/
/*    justify-content:start; !* Vertically align items in the center *!*/
/*    !*gap: 10px;*!*/
/*}*/

.controls {
    display: flex;
    align-items: center; /* Vertically align items in the center */
    justify-content: start;
    gap: 10px; /* Add space between items */
}

.left-controls, .right-controls {
    display: flex;
    align-items: center; /* Vertically align items in the center */

}

.control-row {
    display: flex;
    align-items: center; /* Vertically align items in the center */
    justify-content: space-between;
    gap: 20px; /* Add space between items */
}

/*.controls .control-item {*/
/*    margin-right: 0; !* Remove right margin *!*/
/*}*/

.controls .control-item {
    margin-right: 10px;
}

/*#loop-toggle {*/
/*    align-self: flex-start;*/
/*    padding: 10px;*/
/*    border: 1px solid #ddd;*/
/*    border-radius: 4px;*/
/*}*/

.accent-title {
    font-weight: 500;
    color: #555;
}

.accent {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.input-group {
    display: grid;
    grid-template-columns: auto auto; /* Two columns: auto for labels, 1fr for inputs */
    gap: 10px;
    align-items: center;
    margin-bottom: 5px;
    justify-items: start;
}

.input-groups {
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(2, auto);
    grid-template-rows: 30px 30px 30px;
    gap: 5px;
    align-items: center; /* Center items vertically */
}

label {
    justify-self: right;
    text-align: right;
    font-size: 12px;
    font-weight: bold;
}

.input-groups input, .input-groups select {
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    width: 35px;
    appearance: none;
}

.accent-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap; /* Prevent wrapping */
    grid-column: span 2; /* Span 3 columns */
    border: none;
}

.tempo-slider-container {
    display: flex;
    align-items: center;
    /*gap: 10px;*/
    grid-column: span 2; /* Span 3 columns */
}
.range-container {
    display: flex;
    align-items: center;
}

.tempo-controls {
    display: flex;
    align-items: center;
}

.input-groups .tempo-slider {
    width: 80px;
}

.tempo-slider {
    -webkit-appearance: none; /* Remove default styling */
    width: 200px;
    height: 4px; /* Thin line */
    background: #ddd; /* Line color */
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.input-value {
    font-size: 12px;
    /*margin-left: 2px;*/
    /*margin-right: 2px;*/
}
#tempo-value {
    font-size: 12px;
    margin-left: 2px;
    margin-right: 2px;
}

.tempo-slider:hover {
    opacity: 1; /* Increase opacity on hover */
}

/* Style the slider thumb */
.tempo-slider::-webkit-slider-thumb {
    -webkit-appearance: none; /* Remove default styling */
    appearance: none;
    width: 16px; /* Circle size */
    height: 16px; /* Circle size */
    background: #4CAF50; /* Circle color */
    border-radius: 50%; /* Make it a circle */
    cursor: pointer;
    transition: background-color 0.3s;
}

.tempo-slider::-webkit-slider-thumb:hover {
    background: #45a049; /* Change color on hover */
}

.tempo-slider::-moz-range-thumb {
    width: 16px; /* Circle size */
    height: 16px; /* Circle size */
    background: #4CAF50; /* Circle color */
    border-radius: 50%; /* Make it a circle */
    cursor: pointer;
    transition: background-color 0.3s;
}

.tempo-slider::-moz-range-thumb:hover {
    background: #45a049; /* Change color on hover */
}

/*.tempo-slider-container */
.range-button {
    background-color: white;
    border: none; /* Remove borders */
    color: #4CAF50;; /* White text */
    width: 15px; /* Set a fixed width */
    height: 15px; /* Set a fixed height */
    cursor: pointer; /* Pointer/hand icon */
    display: flex; /* Center the icon */
    align-items: center; /* Center the icon */
    justify-content: center; /* Center the icon */
    font-size: 18px; /* Increase font size */
}

/*.tempo-slider-container */
.range-button:hover {
    /*background-color: #45a049; !* Darker green on hover *!*/
}



.accent-container {
    display: flex;
    //gap: 10px;
    align-items: center;
    flex-wrap: nowrap; /* Prevent wrapping */
    border: none;
}

.note-value option {
    font-family: 'Arial', sans-serif; /* Ensure the note symbols are displayed correctly */
    font-size: 16px; /* Adjust the font size as needed */
}

/* The container */
/* The container */
.toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: auto;
    height: 16px; /* Reduced height */
}

/* Hide the default checkbox */
.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: relative;
    cursor: pointer;
    width: 28px; /* Reduced width */
    height: 16px; /* Reduced height */
    background-color: #ccc; /* Default background color for off state */
    transition: .4s;
    border-radius: 8px; /* Adjusted border radius */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* The slider before */
.slider:before {
    position: absolute;
    content: "";
    height: 12px; /* Reduced height */
    width: 12px; /* Reduced width */
    left: 2px; /* Adjusted position */
    bottom: 2px; /* Adjusted position */
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* Checked state */
input:checked + .slider {
    background-color: #4CAF50; /* Background color for on state */
}

/* Move the slider when checked */
input:checked + .slider:before {
    transform: translateX(12px); /* Adjusted translation */
}