/* WeChat Draft Modal Styles */
.wechat-draft-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wechat-draft-modal.active {
    opacity: 1;
    visibility: visible;
}

.wechat-draft-content {
    background: #fff;
    width: 800px;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wechat-draft-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wechat-draft-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.wechat-draft-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.wechat-draft-close:hover {
    color: #333;
}

.wechat-draft-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    gap: 24px;
}

.wechat-draft-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wechat-draft-right {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.form-group input[type="text"],
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    border-color: #07c160;
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.cover-preview-container {
    width: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid #eee;
}

.cover-preview-img {
    width: 100%;
    height: auto;
    display: block;
}

.crop-overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through initially */
}

.crop-box {
    position: absolute;
    border: 2px solid #07c160;
    background: rgba(7, 193, 96, 0.1);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); /* Dim outside */
    cursor: move;
    pointer-events: auto;
    display: none; /* Hidden by default */
}

.crop-box.active {
    display: block;
}

.crop-handle {
    width: 10px;
    height: 10px;
    background: #07c160;
    border: 1px solid #fff;
    position: absolute;
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

.crop-actions {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-crop-toggle {
    font-size: 13px;
    color: #07c160;
    background: none;
    border: 1px solid #07c160;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-crop-toggle:hover,
.btn-crop-toggle.active {
    background: #07c160;
    color: #fff;
}

.advanced-options {
    margin-top: 16px;
    border-top: 1px solid #eee;
    padding-top: 16px;
}

.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    user-select: none;
}

.advanced-toggle i {
    transition: transform 0.2s;
}

.advanced-toggle.open i {
    transform: rotate(90deg);
}

.advanced-content {
    display: none;
    margin-top: 16px;
    flex-direction: column;
    gap: 16px;
}

.advanced-content.open {
    display: flex;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-group input {
    width: 16px;
    height: 16px;
}

.checkbox-group span {
    font-size: 14px;
    color: #333;
}

.wechat-draft-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    padding: 8px 24px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.btn-save {
    padding: 8px 24px;
    background: #07c160;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-save:hover {
    background: #06ad56;
}

.btn-save:disabled {
    background: #a0eac6;
    cursor: not-allowed;
}

.btn-save .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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