/*
 * dialog-essaypicker.css
 *
 * Styles for Essay Picker dialog
 */

/* *******************************************************
 * Dialog sizing
 * ******************************************************* */

#essayPickerModal .db-dialog {
    max-width: 720px;
    width: 94%;
    max-height: 90vh;
}

/* *******************************************************
 * Filter row — three dropdowns side by side on desktop
 * ******************************************************* */

.ep-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    align-items: end;
}

.ep-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.ep-filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ep-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.9);
    color-scheme: dark;
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: auto;
}

.ep-select option {
    background-color: #1e2030;
    color: rgba(255,255,255,0.9);
}

.ep-select:focus {
    outline: none;
    border-color: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}

/* *******************************************************
 * Fetch button — full width, distinct from Select
 * ******************************************************* */

.ep-fetch-row {
    display: flex;
    justify-content: stretch;
}

.ep-fetch-row .db-btn {
    flex: 1;
    background: #2dd4bf;
    border-top: 3px solid #5ef0de;
    border-bottom: 3px solid #0f8a7a;
    color: #0a2218;
    font-size: 1rem;
    padding: 12px;
}

.ep-fetch-row .db-btn:hover:not(:disabled) {
    background: #3de0cb;
    border-top-color: #72f4e6;
    border-bottom-color: #1aaa8e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(45, 212, 191, 0.3);
}

/* *******************************************************
 * Essay textarea
 * ******************************************************* */

.ep-textarea-wrap {
    position: relative;
    width: 100%;
}

.ep-text-area {
    min-height: 180px;
    max-height: 40vh;
    resize: vertical;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.88);
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 22px; /* room for the counter */
}

.ep-text-area:not(:placeholder-shown) {
    background: rgba(255,255,255,0.07);
}

.ep-char-counter {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 0.72rem;
    font-family: 'Inter', monospace;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.45);
    padding: 1px 6px;
    border-radius: 4px;
    pointer-events: none;
    user-select: none;
}

/* *******************************************************
 * Select button — full width, green
 * ******************************************************* */

.ep-select-row {
    display: flex;
    justify-content: stretch;
}

.ep-select-row .db-btn {
    flex: 1;
    background: #2dd4bf;
    border-top: 3px solid #5ef0de;
    border-bottom: 3px solid #0f8a7a;
    color: #0a2218;
    font-size: 1rem;
    padding: 12px;
}

.ep-select-row .db-btn:hover:not(:disabled) {
    background: #3de0cb;
    border-top-color: #72f4e6;
    border-bottom-color: #1aaa8e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(45, 212, 191, 0.3);
}

.ep-select-row .db-btn:disabled {
    background: #ccc;
    color: #888;
}

/* *******************************************************
 * Mobile layout — stack dropdowns vertically
 * ******************************************************* */

@media (max-width: 600px) {
    #essayPickerModal .db-dialog {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        max-width: 100%;
    }


    .ep-filter-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ep-text-area {
        min-height: 140px;
        max-height: 30vh;
    }

    .ep-select {
        font-size: 1rem;
        padding: 12px 14px;
    }
}
