/**
 * Neo Framework - 共用樣式
 * 前後台都可使用的通用樣式
 */

/* 全域重置 */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

/* 通用工具類 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* 狀態標籤 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-published {
    background: #d1ecf1;
    color: #0c5460;
}

/* 圖片預覽 */
.image-preview {
    max-width: 200px;
    max-height: 200px;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    padding: 5px;
    object-fit: cover;
}

.form-input-reminder {
    font-size: .875rem;
    line-height: 1.4;
    color: #999;
    margin-top: 10px;
}

.uk-button {
    justify-content: center;
    display: flex;
    gap: 10px;
    align-items: center;
}

.uk-notification {
    z-index: 10100 !important; /* 確保顯示在 loading overlay 之上 */
}

.uk-notification-message {
    background: #2f2f2f;
    color: #fff;
    font-size: .9rem;
}

.uk-input,
.uk-select,
.uk-textarea,
.uk-button,
.uk-notification-message  {
    border-radius: 4px;
}

tr {
    transition: background-color 0.6s ease-out;
}

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


/* ==================== Neo Toggle Switch ==================== */
.neo-toggle-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.neo-toggle {
    position: relative;
    display: inline-block;
}

/* 尺寸變體 */
.neo-toggle-small {
    width: 36px;
    height: 20px;
}

.neo-toggle-medium {
    width: 44px;
    height: 24px;
}

.neo-toggle-large {
    width: 52px;
    height: 28px;
}

.neo-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.neo-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 50px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.neo-toggle-slider:before {
    position: absolute;
    content: "";
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 小尺寸滑塊 */
.neo-toggle-small .neo-toggle-slider:before {
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
}

/* 中尺寸滑塊 */
.neo-toggle-medium .neo-toggle-slider:before {
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
}

/* 大尺寸滑塊 */
.neo-toggle-large .neo-toggle-slider:before {
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
}

/* 選中狀態 - 滑塊位置 */
.neo-toggle-small input:checked + .neo-toggle-slider:before {
    transform: translateX(16px);
}

.neo-toggle-medium input:checked + .neo-toggle-slider:before {
    transform: translateX(20px);
}

.neo-toggle-large input:checked + .neo-toggle-slider:before {
    transform: translateX(24px);
}

/* 顏色變體 - Primary */
.neo-toggle-primary input:checked + .neo-toggle-slider {
    background-color: #1e87f0;
}

/* 顏色變體 - Success */
.neo-toggle-success input:checked + .neo-toggle-slider {
    background-color: #32d296;
}

/* 顏色變體 - Warning */
.neo-toggle-warning input:checked + .neo-toggle-slider {
    background-color: #faa05a;
}

/* 顏色變體 - Danger */
.neo-toggle-danger input:checked + .neo-toggle-slider {
    background-color: #f0506e;
}

/* 停用狀態 */
.neo-toggle input:disabled + .neo-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Focus 狀態 */
.neo-toggle input:focus + .neo-toggle-slider {
    box-shadow: 0 0 0 2px rgba(30, 135, 240, 0.3);
}

/* 標籤樣式 */
.neo-toggle-label,
.neo-toggle-label-on,
.neo-toggle-label-off {
    font-size: 14px;
    color: #666;
}

.neo-toggle-wrapper:hover .neo-toggle-label,
.neo-toggle-wrapper:hover .neo-toggle-label-on,
.neo-toggle-wrapper:hover .neo-toggle-label-off {
    color: #333;
}
