/* -------------------------------------------------------
   GLOBAL LAYOUT
------------------------------------------------------- */

.tone-app {
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    color: #222;
    padding: 12px;
    max-width: 720px;
    margin: 0 auto;
}

.tone-heading-panel {
    text-align: center;
    margin-bottom: 20px;
}

.tone-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #8B0000;
    margin: 0;
}

.tone-subtitle {
    font-size: 1rem;
    color: #555;
    margin-top: 4px;
}


/* -------------------------------------------------------
   MAIN PANEL
------------------------------------------------------- */

.tone-main-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* -------------------------------------------------------
   SEQUENCER
------------------------------------------------------- */

.tone-sequencer {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.tone-track {
    flex: 1;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.tone-track-heading {
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: #8B0000;
}

.tone-track-tones {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* Tone boxes */
.tone-box {
    padding: 10px;
    border-radius: 8px;
    border: 2px solid rgba(0,0,0,0.15);
    text-align: center;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tone-box:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Selected tone highlight */
.tone-box.selected {
    outline: 4px solid #000;
    outline-offset: -4px; /* pulls the outline inward */
    box-shadow: 0 0 10px rgba(0,0,0,0.35);
}


/* Add button */
.tone-add-button {
    margin-top: 10px;
    align-self: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #8B0000;
    background: #fff;
    color: #8B0000;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tone-add-button:hover {
    background: #8B0000;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}


/* -------------------------------------------------------
   TONE EDITOR
------------------------------------------------------- */

.tone-editor {
    border: 3px solid #8B0000;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

.tone-editor-toprow {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.tone-editor-toprow button {
    background: #f3f3f3;
    border: 1px solid #ccc;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}
.tone-editor-label {
    font-weight: bold;
    font-size: 18px;
    margin-right: auto; /* pushes buttons to the right */
}
.tone-editor-toprow button:hover {
    background: #e5e5e5;
}

.tone-editor-toprow .ok-button {
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: #2ecc71;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Preset picker */
.tone-preset-picker {
    margin-bottom: 10px;
}

.tone-preset-collapsed {
    padding: 8px 10px;
    background: #f7f7f7;
    border: 2px solid #ccc;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 6px;
}
.tone-preset-collapsed::after {
    content: "▼";
    float: right;
    opacity: 0.6;
}



.tone-preset-expanded {
    margin-top: 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.8s ease-out;
}

.tone-preset-item {
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.tone-preset-item:hover {
    background: #f0f0f0;
}

.tone-preset-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid #000;
}

.tone-preset-meaning {
    margin: 10px 0;
    font-style: italic;
    color: #444;
}

/* Tone controls */
.tone-control {
    margin-bottom: 12px;
}

.tone-control label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.tone-control input,
.tone-control select {
    width: 100%;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
}

/* Compact sliders */
.tone-control input[type="range"] {
    max-width: 120px;   
    width: 100%;        
    margin-left: 0;     
    accent-color: #444;
}


/* Volume + Pan side‑by‑side */
.tone-control.volume-pan-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.tone-control.volume-pan-row .tone-control {
    flex: 1;
    margin-bottom: 0; /* remove extra spacing */
}

.tone-control.volume-pan-row input[type="range"] {
    width: 100%; /* sliders expand nicely */
}




/* Done button */
.tone-editor-done {
    width: 100%;
    padding: 10px;
    background: #8B0000;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    cursor: pointer;
}

.tone-editor-done:hover {
    background: #A30000;
}


/* -------------------------------------------------------
   CONTROL PANEL — EDITOR
------------------------------------------------------- */

.tone-control-panel-editor {
    background: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px;
}

.tone-control-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.tone-play-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #2ecc71;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tone-play-button:hover {
    background: #27ae60;
}

.tone-control-row .tone-control {
    flex: 1;
}

/* Master volume sliders */
.tone-master-volume,
.tone-master-volume-player {
    width: 75%;
    max-width: 180px;
}

@media (min-width: 700px) {
    .tone-master-volume,
    .tone-master-volume-player {
        width: 25%;
        max-width: 200px;
    }
}


/* -------------------------------------------------------
   PREMIUM BUTTONS
------------------------------------------------------- */

.tone-premium-controls button {
    padding: 8px 14px;
    background: #8B0000;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
}

.tone-premium-controls button:hover {
    background: #A30000;
}


/* -------------------------------------------------------
   PLAYER MODE
------------------------------------------------------- */

.tone-player-mode {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px;
}

.tone-player-display {
    margin-bottom: 12px;
}

.tone-stop-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #e74c3c;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tone-stop-button:hover {
    background: #c0392b;
}

.tone-control-panel-player .tone-control {
    margin-top: 8px;
}


/* -------------------------------------------------------
   RESPONSIVE
------------------------------------------------------- */

@media (max-width: 480px) {
    .tone-app {
        padding: 8px;
        max-width: 100%;
    }

    .tone-sequencer {
        gap: 8px;
    }

    .tone-track {
        padding: 6px;
    }

    .tone-title {
        font-size: 1.5rem;
    }
}


/* -------------------------------------------------------
   FOOTER
------------------------------------------------------- */

#tone-footer-panel {
    text-align: center;
    margin-top: 24px;
    padding: 14px 0;
    font-size: 1rem;
    color: #444;
    opacity: 0.9;
}

#tone-footer-panel p {
    margin: 0;
    line-height: 1.5;
}

#tone-footer-panel a {
    color: #8B0000;
    text-decoration: none;
    font-weight: 600;
}

#tone-footer-panel a:hover {
    color: #A30000;
    text-decoration: underline;
}

/* Desktop width control */
#ramapani-tone-app {
    width: 100%;
    max-width: 66%;
    margin: 0 auto;
}

/* Mobile override */
@media (max-width: 700px) {
    #ramapani-tone-app {
        max-width: 100%;
        width: 100%;
    }
}

.swal-popup {
    border-radius: 14px;
    padding: 1.8rem;
}

.swal-confirm {
    background: #6a4df5;
    color: white;
    border-radius: 8px;
    padding: 10px 22px;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.swal-cancel {
    background: #e0e0e0;
    color: #333;
    border-radius: 8px;
    padding: 10px 22px;
    border: none;
    font-weight: 600;
    cursor: pointer;
}



.chakra-table {
  width: 100%;
  border-collapse: collapse;
  font-family: system-ui, sans-serif;
  font-size: 15px;
  color: #333;
}

.chakra-table th,
.chakra-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e5e5;
}

.chakra-table th {
  text-align: left;
  font-weight: 600;
  color: #555;
}

.chakra-table tr:last-child td {
  border-bottom: none;
}

.chakra-table tr:hover td {
  background: #fafafa;
}
