/* Manage Flips Dialog Stylesheet */

/* Modal overlay - unique class to avoid conflicts */
.mf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.mf-modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Modal body scrolls independently so the footer always stays visible */
.mf-modal-dialog .modal-body {
    overflow-y: auto;
    flex: 1;
    padding-bottom: 10px;
}

/* Permanent footer — always rendered, fixed height, never scrolls away */
.mf-modal-footer {
    flex-shrink: 0;
    height: 42px;
    border-top: 2px solid #555;
    border-radius: 0 0 12px 12px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

/* Status fills the full footer area — always has a background */
.mf-modal-footer .dialog-status {
    flex: 1;
    padding: 10px 25px;
    margin: 0;
    background: #d1ecf1;
    color: #0c5460;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.mf-modal-footer .dialog-status.error {
    background: #f8d7da;
    color: #721c24;
}

.mf-modal-footer .dialog-status.success {
    background: #d4edda;
    color: #155724;
}

/* Flip Count Indicator (uses same styling as dialog-managevoices.css) */
.mf-modal-dialog .flip-count-indicator {
    display: inline-block;
    flex-shrink: 0;
    background-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    min-width: 50px;
    text-align: center;
}

.mf-modal-dialog .flip-count-indicator.at-limit {
    background-color: #dc3545;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.4);
}

/* Flips table container */
.flips-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Flips table */
.flips-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.flips-table thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

.flips-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.flips-table th:first-child {
    width: 50px;
    text-align: center;
}

.flips-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.flips-table tbody tr:hover {
    background-color: #f8f9fa;
}

.flips-table tbody tr.selected {
    background-color: #e3f2fd;
}

.flips-table td {
    padding: 12px;
}

.flips-table td:first-child {
    text-align: center;
}

/* Radio button styling */
.flips-table input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Flip name cell */
.flip-name-cell {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

/* Flip description text (shown below name) */
.flip-description {
    display: block;
    font-size: 0.78rem;
    color: #888;
    font-weight: 400;
    margin-top: 2px;
}

/* Flip duration cell */
.flip-duration-cell {
    font-size: 0.8rem;
    color: #666;
    font-family: monospace;
    white-space: nowrap;
}

/* Smaller modal variant (for rename and delete dialogs) */
.mf-modal-dialog-small {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 100%;
}

/* Delete flip name */
.delete-flip-name {
    font-weight: 600;
    color: #dc3545;
}

/* Audio Player section */
.mf-audioplayer-section {
    margin-top: 16px;
    margin-bottom: 4px;
}

/* Controls row: playback buttons on the left, download button on the right */
.mf-player-controls-row {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

/* Playback buttons row */
.mf-player-buttons-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0;
}

/* Download button area to the right of playback buttons */
.mf-player-buttons-right {
    display: flex;
    align-items: center;
    padding-left: 12px;
}

/* Override ghosted state specifically for mf buttons to not block pointer when enabled */
.mf-player-btn {
    pointer-events: auto;
    cursor: pointer;
}

.mf-player-btn-ghosted {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile/Phone Responsive Layout */
@media (max-width: 600px) {
    .mf-modal-dialog-small {
        max-width: 90%;
        margin: 0 20px;
    }

    .flips-table-container {
        max-height: 250px;
    }

    .flips-table th,
    .flips-table td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }

    .flips-table th:first-child,
    .flips-table td:first-child {
        width: 40px;
    }

    .flips-table input[type="radio"] {
        width: 18px;
        height: 18px;
    }
}
