/* Viết Hợp Âm (Form) — styles */

.cwf-form {
    max-width: 760px;
    margin: 0 auto;
    font-size: 15px;
}

.cwf-heading {
    margin: 28px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ed1c24;
    color: #222;
    font-size: 19px;
    font-weight: 700;
}

.cwf-row,
.cwf-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.cwf-grid .cwf-field {
    flex: 1 1 220px;
}

.cwf-field-full {
    flex: 1 1 100% !important;
}

.cwf-field {
    margin-bottom: 4px;
}

.cwf-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.cwf-required {
    color: #ed1c24;
}

.cwf-field input,
.cwf-field select,
.cwf-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 15px;
    box-sizing: border-box;
}

.cwf-field textarea {
    font-family: Consolas, Monaco, "Courier New", monospace;
    line-height: 1.6;
    resize: vertical;
}

/* Nội dung bài hát: tự tăng chiều cao theo nội dung, không cuộn */
#cwf_lyrics {
    resize: none;
    overflow-y: hidden;
    min-height: 320px;
}

/* Xem trước full (như trang xem hợp âm) */
.cwf-full-preview-wrap {
    margin-top: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.cwf-full-preview-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}
.cwf-full-preview-sub {
    font-size: 12px;
    color: #888;
}
.cwf-preview-btn {
    margin-left: auto;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #1976d2;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.cwf-preview-btn:hover { background: #1565c0; }
.cwf-preview-btn:disabled { opacity: .6; cursor: default; }
.cwf-full-preview {
    padding: 20px;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    min-height: 120px;
}
.cwf-preview-loading { color: #888; }
.cwf-preview-error { color: #ed1c24; }

.cwf-field input[type="file"] {
    padding: 8px 10px;
    border: 1px dashed #bbb;
    background: #fafafa;
    cursor: pointer;
}

.cwf-file-name {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #2f9dae;
    font-weight: 600;
    word-break: break-all;
}

.cwf-field input:focus,
.cwf-field select:focus,
.cwf-field textarea:focus {
    outline: none;
    border-color: #ed1c24;
    box-shadow: 0 0 0 2px rgba(237, 28, 36, 0.15);
}

.cwf-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.cwf-tool {
    padding: 6px 14px;
    background: #f2f2f2;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    transition: all 0.15s ease;
}

.cwf-tool:hover {
    background: #ed1c24;
    border-color: #ed1c24;
    color: #fff;
}

.cwf-submit {
    display: inline-block;
    padding: 13px 34px;
    background: #ed1c24;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cwf-submit:hover {
    background: #c9181f;
}

.cwf-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cwf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.cwf-submit-request {
    display: inline-block;
    padding: 13px 24px;
    background: #446084;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cwf-submit-request:hover {
    background: #365277;
}

.cwf-submit-request:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === Modal xác nhận trước khi gửi === */
.cwf-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cwf-confirm-dialog {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.cwf-confirm-message {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.cwf-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cwf-confirm-cancel,
.cwf-confirm-ok {
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
}

.cwf-confirm-cancel {
    background: #f1f1f1;
    color: #333;
}

.cwf-confirm-cancel:hover {
    background: #e5e5e5;
}

.cwf-confirm-ok {
    background: #ed1c24;
    color: #fff;
}

.cwf-confirm-ok:hover {
    background: #c9181f;
}

.cwf-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #777;
}

.cwf-hint code {
    background: #f4f4f4;
    padding: 1px 5px;
    border-radius: 3px;
    color: #c9181f;
}

.cwf-message {
    max-width: 760px;
    margin: 18px auto 0;
    padding: 14px 18px;
    border-radius: 4px;
    display: none;
    font-size: 15px;
}

.cwf-message.cwf-success {
    display: block;
    background: #eaf7ea;
    border: 1px solid #b6dcb6;
    color: #1e7e1e;
}

.cwf-message.cwf-error {
    display: block;
    background: #fdecec;
    border: 1px solid #f3b6b6;
    color: #b01a1a;
}

.cwf-message a {
    font-weight: 700;
    text-decoration: underline;
}

/* Phiên bản YouTube: Link - Ca sĩ - Tone */
.cwf-versions {
    margin-bottom: 8px;
}

.cwf-version-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.cwf-version-warn {
    flex-basis: 100%;
    font-size: 12px;
    color: #b01a1a;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 2px;
}

.cwf-version-row input {
    width: auto;
}

.cwf-version-row .cwf-version-url {
    flex: 2 1 240px;
    min-width: 0;
}

.cwf-version-row .cwf-version-singer {
    flex: 1 1 140px;
    min-width: 0;
}

.cwf-version-row .cwf-version-tone {
    flex: 0 1 90px;
    min-width: 0;
}

.cwf-remove-version {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: none;
    background: #f2f2f2;
    color: #b01a1a;
    border-radius: 4px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.cwf-remove-version:hover {
    background: #ed1c24;
    color: #fff;
}

.cwf-add-version {
    padding: 8px 16px;
    background: #2f9dae;
    border: none;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 4px;
}

.cwf-add-version:hover {
    background: #257e8c;
}
