/* ============================================
   ManageAPIs - หน้าการจัดการ API
   ============================================ */

/* ----- Wrapper ----- */
.manageapis-wrapper {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* ----- Grid Layout ----- */
.manageapis-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .manageapis-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* ----- ฟอร์มตั้งค่า ----- */
.manageapis-form-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.manageapis-form-box {
    background-color: rgba(31, 41, 55, 0.5);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.manageapis-form-title {
    font-size: 1.28rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}
.manageapis-form-title i {
    margin-right: 0.5rem;
    color: #818cf8;
}

/* ----- Webhook URL ----- */
.manageapis-webhook-wrapper {
    border-radius: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.manageapis-webhook-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.manageapis-webhook-content {
    flex: 1;
    min-width: 0;
}

.manageapis-webhook-input-wrapper {
    position: relative;
}

.manageapis-webhook-input {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: rgba(17, 24, 39, 0.5);
    border: 1px solid #4b5563;
    color: #ffffff;
    width: 100%;
}

.manageapis-webhook-code {
    color: #93c5fd;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 50px);
}

.manageapis-webhook-copy-btn {
    color: #9ca3af;
    padding: 0.45rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    position: absolute;
    right: 0.45rem;
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}
.manageapis-webhook-copy-btn:hover {
    color: #ffffff;
    background-color: rgba(99, 102, 241, 0.2);
}
@media (max-width: 768px) {
    .manageapis-webhook-copy-btn {
        right: 0.25rem;
        padding: 0.3rem;
        font-size: 0.75rem;
    }
}

.manageapis-webhook-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* ----- ฟอร์ม ----- */
.manageapis-form-input-wrapper {
    position: relative;
}

.manageapis-form-input-text {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(17, 24, 39, 0.5);
    border: 1px solid #4b5563;
    color: #ffffff;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.manageapis-form-input-text:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}
.manageapis-form-input-text::placeholder {
    color: #6b7280;
}

.manageapis-form-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.manageapis-slip-hidden {
    display: none;
}

.manageapis-submit-wrapper {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* เกี่ยวกับ (การกดปุ่ม X กากบาท เคลียร์ข้อมูลในช่องกรอก Input) */
.manageapis-input-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: color 0.2s, background-color 0.2s;
}
.manageapis-input-clear:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}
@media (max-width: 768px) {
    .manageapis-input-clear {
        right: 0.35rem;
        padding: 0.25rem;
        font-size: 0.8rem;
    }
}

/* ----- Sidebar (ข้อมูลร้านค้า + สถานะระบบ) ----- */
.manageapis-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ----- ข้อมูลร้านค้า ----- */
.manageapis-store-box {
    background: linear-gradient(to bottom right, #1f2937, #111827);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    position: relative;
}

.manageapis-store-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}
.manageapis-store-title i {
    margin-right: 0.5rem;
    color: #4ade80;
}

.manageapis-store-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.manageapis-store-list li {
    margin-bottom: 0.75rem;
}

.manageapis-store-list li:last-child {
    margin-bottom: 0;
}

.manageapis-store-item {
    display: flex;
    justify-content: space-between;
}

.manageapis-store-label {
    color: #9ca3af;
}

.manageapis-store-value {
    color: #86efac;
    font-weight: 500;
}

/* ----- สถานะระบบ ----- */
.manageapis-status-box {
    background: linear-gradient(to bottom right, #1f2937, #111827);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.manageapis-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.manageapis-status-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #ffffff;
    display: flex;
    align-items: center;
}
.manageapis-status-title i {
    margin-right: 0.5rem;
    color: #60a5fa;
}

.manageapis-status-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}
.manageapis-status-badge.ready {
    color: #4ade80;
}
.manageapis-status-badge.incomplete {
    color: #facc15;
}

.manageapis-status-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.manageapis-status-list li {
    margin-bottom: 1rem;
}

.manageapis-status-list li:last-child {
    margin-bottom: 0;
}

.manageapis-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

.manageapis-status-label {
    color: #9ca3af;
}

.manageapis-status-value {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.manageapis-status-value.set {
    color: #4ade80;
}
.manageapis-status-value.notset {
    color: #f87171;
}


