/**
 * Colt Excerpt - CSS สำหรับการแสดงผล
 * 
 * @package     Colt_Excerpt
 * @version     1.0.0
 */

/* คอนเทนเนอร์หลัก */
.colt-excerpt-container {
    position: relative;
    margin: 1.5em 0;
    padding: 1.25em;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.colt-excerpt-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* เนื้อหา Excerpt */
.colt-excerpt-content {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 0.5em;
}

/* ปุ่มแก้ไข */
.colt-excerpt-actions {
    position: absolute;
    top: 0.75em;
    right: 0.75em;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.colt-excerpt-container:hover .colt-excerpt-actions {
    opacity: 1;
}

.colt-excerpt-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.colt-excerpt-edit-btn:hover {
    color: #1e88e5;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.colt-excerpt-edit-btn svg {
    width: 16px;
    height: 16px;
}

/* ฟอร์มแก้ไข */
.colt-excerpt-edit-form {
    margin-top: 0.75em;
}

.colt-excerpt-textarea {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}

.colt-excerpt-textarea:focus {
    outline: none;
    border-color: #1e88e5;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.2);
}

/* ตัวนับจำนวนตัวอักษร */
.colt-excerpt-char-count {
    text-align: right;
    margin-top: 0.5em;
    font-size: 12px;
    color: #777;
}

.colt-excerpt-char-count span.colt-excerpt-near-max {
    color: #ff9800;
}

.colt-excerpt-char-count span.colt-excerpt-max-reached {
    color: #f44336;
    font-weight: bold;
}

/* ปุ่มในฟอร์ม */
.colt-excerpt-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75em;
    margin-top: 1em;
}

.colt-excerpt-cancel-btn,
.colt-excerpt-update-btn {
    padding: 0.6em 1.2em;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.colt-excerpt-cancel-btn {
    background-color: transparent;
    color: #666;
    border: 1px solid #ddd;
}

.colt-excerpt-cancel-btn:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.colt-excerpt-update-btn {
    background-color: #1e88e5;
    color: white;
    border: 1px solid #1976d2;
}

.colt-excerpt-update-btn:hover {
    background-color: #1976d2;
}

/* สถานะ */
.colt-excerpt-status {
    padding: 0.75em;
    margin-top: 0.75em;
    border-radius: 4px;
    text-align: center;
}

.colt-excerpt-status-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.colt-excerpt-status-error {
    background-color: #ffebee;
    color: #c62828;
}

/* ตัวโหลด */
.colt-excerpt-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 0.5em;
}

.colt-excerpt-loading span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #1e88e5;
    animation: colt-excerpt-bounce 1.4s infinite ease-in-out both;
}

.colt-excerpt-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.colt-excerpt-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes colt-excerpt-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* สำหรับอุปกรณ์มือถือ */
@media (max-width: 600px) {
    .colt-excerpt-container {
        padding: 1em;
    }
    
    .colt-excerpt-actions {
        opacity: 1;
    }
    
    .colt-excerpt-form-actions {
        flex-direction: column;
        gap: 0.5em;
    }
    
    .colt-excerpt-cancel-btn,
    .colt-excerpt-update-btn {
        width: 100%;
    }
}