/**
 * FM2 Featured Image CSS
 * สไตล์สำหรับ Featured Image Shortcode
 */

.fm2-featured-img-container {
    max-width: 600px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f7f7f7;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fm2-featured-img-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.fm2-image-preview {
    margin-bottom: 15px;
    min-height: 100px;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 3px;
}

.fm2-current-image {
    position: relative;
}

.fm2-current-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.fm2-no-image {
    padding: 30px;
    text-align: center;
    color: #999;
    font-style: italic;
    background-color: #f0f0f0;
    border-radius: 3px;
}

.fm2-upload-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.fm2-upload-options {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
}

.fm2-upload-button {
    padding: 8px 15px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.fm2-upload-button:hover {
    background-color: #005a87;
}

.fm2-upload-or {
    margin: 0 15px;
    color: #666;
    font-style: italic;
}

.fm2-dropzone {
    width: 100%;
    border: 2px dashed #ccc;
    border-radius: 5px;
    padding: 20px;
    text-align: center;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.fm2-dropzone-active {
    background-color: #e8f4fd;
    border-color: #0073aa;
}

.fm2-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fm2-dropzone-icon {
    margin-bottom: 10px;
    color: #777;
}

.fm2-dropzone-icon svg {
    width: 32px;
    height: 32px;
}

.fm2-dropzone-text {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.fm2-file-input-container {
    margin-top: 10px;
    position: relative;
}

.fm2-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.fm2-file-label {
    display: inline-block;
    padding: 6px 12px;
    background-color: #e6e6e6;
    color: #333;
    font-size: 14px;
    font-weight: normal;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.fm2-file-label:hover {
    background-color: #d9d9d9;
}

.fm2-remove-image {
    padding: 5px 10px;
    background-color: #dc3232;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    transition: background-color 0.2s;
}

.fm2-remove-image:hover {
    background-color: #b32424;
}

.fm2-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 3px;
    font-size: 14px;
    display: none;
    width: 100%;
}

.fm2-message-success {
    background-color: #ecf7ed;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.fm2-message-error {
    background-color: #fdecea;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.fm2-message-info {
    background-color: #e8f4fd;
    color: #0277bd;
    border: 1px solid #b3e5fc;
}

.fm2-upload-progress {
    width: 100%;
    margin-top: 10px;
    background-color: #f0f0f0;
    border-radius: 3px;
    height: 20px;
    position: relative;
    overflow: hidden;
}

.fm2-progress-bar {
    height: 100%;
    background-color: #0073aa;
    transition: width 0.3s ease;
}

.fm2-progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    line-height: 20px;
    color: #fff;
    font-size: 12px;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* รองรับการแสดงผลบนมือถือ */
@media screen and (max-width: 480px) {
    .fm2-featured-img-container {
        padding: 10px;
    }
    
    .fm2-featured-img-container h3 {
        font-size: 16px;
    }
    
    .fm2-upload-options {
        flex-direction: column;
        align-items: stretch;
    }
    
    .fm2-upload-button,
    .fm2-file-label {
        width: 100%;
        text-align: center;
    }
    
    .fm2-upload-or {
        margin: 10px 0;
        text-align: center;
    }
    
    .fm2-remove-image {
        width: 100%;
        text-align: center;
    }
}