/* Custom styles for the voice generation dashboard */

body 
{
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.container 
{
    max-width: 100%;
}

/* Table specific styles */
table 
{
    font-size: 0.75rem;
    table-layout: auto;
}

td 
{
    padding: 0.25rem 0.5rem;
    vertical-align: middle;
}

th 
{
    padding: 0.5rem 0.25rem;
}

td.dialog-cell 
{
    max-width: 25rem;
    word-wrap: break-word;
    line-height: 1.3;
}

.dialog-text 
{
    min-height: 2rem;
    padding: 0.375rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    background-color: #f9fafb;
    resize: vertical;
}

.editable-style 
{
    width: 100%;
    min-width: 8rem;
    min-height: 100%;
    padding: 0.25rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    background-color: #ffffff;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
}

.editable-style:focus 
{
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

/* Ensure table cells with textarea maintain consistent height */
td.style-cell 
{
    height: auto;
    min-height: 3rem;
}

/* Inherited narrator styling */
.inherited-narrator 
{
    position: relative;
}

.inherited-narrator::after 
{
    content: '↑';
    position: absolute;
    right: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.625rem;
    color: #3b82f6;
    opacity: 0.7;
}



.status-success 
{
    color: #059669;
}

.status-error 
{
    color: #dc2626;
}

.status-info 
{
    color: #2563eb;
}

/* Custom checkbox styles */
input[type="checkbox"] 
{
    width: 1rem;
    height: 1rem;
}

/* Loading animation */
.animate-spin 
{
    animation: spin 1s linear infinite;
}

@keyframes spin 
{
    from 
    {
        transform: rotate(0deg);
    }
    to 
    {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) 
{
    .container 
    {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    table 
    {
        font-size: 0.6875rem;
    }
    
    td.dialog-cell 
    {
        max-width: 12rem;
    }
}

/* Split config row into two rows on mobile */
@media (max-width: 640px)
{
    .config-inner 
    {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .config-inner > div:first-child 
    {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    #clearStorageBtn 
    {
        width: 100%;
    }
}

/* Mobile-first optimization for dashboard table (≤640px) */
@media (max-width: 640px)
{
    /* Hide table header for compact mobile view */
    table.min-w-full thead { display: none; }
    /* Keep only the select-all checkbox visible in header */
    #tableHeader th:first-child { display: table-cell; }

    /* Hide ID columns and paragraph split column on small screens */
    #tableHeader th:nth-child(1),
    #tableHeader th:nth-child(2),
    #tableHeader th:nth-child(3),
    #tableHeader th:nth-child(4),
    #tableHeader th:nth-child(5),
    #tableHeader th:nth-child(6),
    #tableHeader th:nth-child(8),
    #tableHeader th:nth-child(9),
    #tableHeader th:nth-child(10),
    #tableHeader th:nth-child(11)
    {
        display: none;
    }

    #dataTableBody td:nth-child(1),
    #dataTableBody td:nth-child(2),
    #dataTableBody td:nth-child(3),
    #dataTableBody td:nth-child(4),
    #dataTableBody td:nth-child(5),
    #dataTableBody td:nth-child(6),
    #dataTableBody td:nth-child(8),
    #dataTableBody td:nth-child(9),
    #dataTableBody td:nth-child(10),
    #dataTableBody td:nth-child(11)
    {
        display: none;
    }

    /* Make dialog column flexible and full width */
    #dataTableBody td:nth-child(7)
    {
        max-width: 100%;
        display: block;
    }

    /* Reduce cell padding and font for tighter rows */
    #dataTableBody td,
    #tableHeader th
    {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        font-size: 0.6875rem;
    }

    /* Ensure textarea spans available width */
    #dataTableBody td:nth-child(9) .editable-style
    {
        width: 100% !important;
        min-height: 2.25rem;
    }
}

/* Mobile stacked row layout inside dialog cell */
.mobile-row { display: none; }
.desktop-dialog { display: block; }

@media (max-width: 640px)
{
    .mobile-row { display: flex; }
    .desktop-dialog { display: none; }

    .mobile-row 
    {
        gap: 0.5rem;
        padding: 0.25rem 0;
        align-items: center;
    }

    .mobile-row-1 .mobile-right span 
    {
        display: inline-block;
        margin-right: 0.5rem;
        background: #eef2ff;
        padding: 0.125rem 0.375rem;
        border-radius: 9999px;
        font-size: 0.7rem;
        color: #3730a3;
    }

    .mobile-row-1 .mobile-right .narrator-pill
    {
        background: #ecfdf5;
        color: #065f46;
    }

    .mobile-row-2 
    {
        line-height: 1.6;
        padding-left: 0.25rem;
    }

    .mobile-row-3 
    {
        align-items: flex-start;
        gap: 0.5rem;
    }

    .mobile-row-3 .editable-style
    {
        min-height: 2.75rem;
        font-size: 0.75rem;
    }

    .mobile-row-4 button 
    {
        margin-right: 0.25rem;
        flex: 1 1 auto;
    }
}

/* Button hover effects */
button:disabled 
{
    cursor: not-allowed;
}

/* Modal styles */
.modal-backdrop 
{
    backdrop-filter: blur(4px);
}

/* Floating Status Window */
.floating-status 
{
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 24rem;
    max-width: calc(100vw - 2rem);
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    z-index: 1000;
    transition: all 0.3s ease;
}

.floating-status.minimized 
{
    height: auto;
}

.status-header 
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0.5rem 0.5rem 0 0;
    cursor: pointer;
}

.status-controls 
{
    display: flex;
    gap: 0.5rem;
}

.toggle-btn, .clear-btn 
{
    background: none;
    border: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #6b7280;
    transition: all 0.2s;
}

.toggle-btn:hover, .clear-btn:hover 
{
    background: #e5e7eb;
    color: #374151;
}

.status-content 
{
    transition: all 0.3s ease;
    overflow: hidden;
}

.status-content.collapsed 
{
    height: 0;
}

.status-window 
{
    padding: 1rem;
    max-height: 12rem;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    background: #f9fafb;
    margin: 0;
}

/* Responsive adjustments for floating status */
@media (max-width: 768px) 
{
    .floating-status 
    {
        width: calc(100vw - 1rem);
        right: 0.5rem;
        bottom: 0.5rem;
    }
    
    .status-window 
    {
        max-height: 8rem;
    }
}

/* Navigation Styles */
.nav-link 
{
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover 
{
    color: #374151;
    background-color: #f3f4f6;
}

.nav-link.active 
{
    color: #3b82f6;
    background-color: #eff6ff;
}

.mobile-nav-link 
{
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
}

.mobile-nav-link:hover 
{
    color: #374151;
    background-color: #f3f4f6;
}

.mobile-nav-link.active 
{
    color: #3b82f6;
    background-color: #eff6ff;
}

/* Generated Button Styles */
.single-output-btn,
.split-paragraphs-btn 
{
    background-color: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.single-output-btn:hover 
{
    background-color: #2563eb;
}

.split-paragraphs-btn 
{
    background-color: #10b981;
}

.split-paragraphs-btn:hover 
{
    background-color: #059669;
}