/* public/css/style.css */

* {
    font-family: "Noto Sans Thai", serif;
    font-optical-sizing: auto;
    font-style: normal;
}

.text-pur{
    color: #9739EC !important;
}
.text-pur1{
    color: #6366F1 !important;
}

.dashboard-container {
    padding: 1.5rem;
}

.welcome-card {
    background: linear-gradient(94.3deg, #2563eb 0%, #10b981 100%);
    border-radius: 1rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.welcome-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-details h2 {
    font-size: 1.75rem;
    margin: 0;
    font-weight: 600;
}

.welcome-details p {
    margin: 0.25rem 0 0 0;
    opacity: 0.8;
}

.account-type {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-align: right;
}

.account-type small {
    display: block;
    opacity: 0.75;
    font-size: 0.75rem;
    margin-bottom: 0.125rem;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-radius: 1rem;
    color: white;
}

.stat-card.green {
    background: linear-gradient(45deg, #10b981, #059669);
}

.stat-card.purple {
    background: linear-gradient(45deg, #8b5cf6, #7c3aed);
}

.stat-card.orange {
    background: linear-gradient(45deg, #f97316, #ea580c);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.25rem;
}

.stat-details h3 {
    font-size: 1.5rem;
    margin: 0.25rem 0;
    font-weight: 600;
}

.stat-details .stat-title {
    margin: 0;
    opacity: 0.9;
    font-weight: 500;
}

.stat-details .stat-subtitle {
    margin: 0.25rem 0 0 0;
    opacity: 0.7;
    font-size: 0.875rem;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.panel {
    background: #1e2738;
    border-radius: 1rem;
    padding: 1.25rem;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
    color: white;
}

.panel-header i {
    width: 1.25rem;
    margin-right: 0.75rem;
    text-align: center;
    color: #64748b;
}

.panel-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.125rem;
}

.license-item,
.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(30, 41, 59, 0.5);
    color: #e2e8f0;
}

.license-item:last-child,
.status-item:last-child {
    margin-bottom: 0;
}

.license-left,
.status-left {
    display: flex;
    align-items: center;
}

.license-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    opacity: 0.7;
}

.license-count,
.status-value {
    font-weight: 500;
    background: rgba(30, 41, 59, 0.7);
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
}

.license-count {
    color: #60a5fa;
}

.status-indicator {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    margin-right: 1rem;
}

.status-indicator.green {
    background: #10b981;
}

.status-value {
    color: #10b981;
}

.bg-purple {
    background-color: #6f42c1;
}
.text-purple {
    color: #6f42c1;
}

@media (max-width: 992px) {
    .dashboard-panels {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .welcome-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .account-type {
        margin-top: 1rem;
        align-self: flex-start;
    }

    .stat-cards {
        grid-template-columns: 1fr;
    }
}

/* public/css/keys.css - สไตล์ปรับปรุงสำหรับหน้า keys */

/* ปรับแต่งการ์ดสถิติ */
.stat-summary {
    background: rgba(30, 39, 56, 0.5);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-summary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* ปรับแต่งเนื้อหาส่วน */
.section-content {
    background: rgba(30, 39, 56, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.option-container {
    background-color: rgba(30, 39, 56, 0.8);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-control-input:checked {
    background-color: #3a7eff;
    border-color: #3a7eff;
}

.form-check-label {
    font-weight: 500;
}

/* รายการที่สามารถลากเรียงได้ */
.sortable-list {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sortable-list::-webkit-scrollbar {
    width: 6px;
}

.sortable-list::-webkit-scrollbar-track {
    background: transparent;
}

.sortable-list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sortable-item {
    background-color: #1a1f2c !important;
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease-in-out;
}

.sortable-item:hover {
    background-color: #232938 !important;
    transform: translateX(5px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ปรับแต่งฟอร์ม */
.custom-select, .custom-input {
    background-color: #1a1f2c !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
}

.custom-select:focus, .custom-input:focus {
    border-color: #3a7eff !important;
    box-shadow: 0 0 0 0.25rem rgba(58, 126, 255, 0.25) !important;
}

.custom-input-addon {
    background-color: #1a1f2c !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-left: none !important;
    border-radius: 0 0.5rem 0.5rem 0 !important;
}

/* ปรับแต่งกล่องข้อมูล */
.info-box {
    background-color: rgba(58, 126, 255, 0.1);
    border: 1px solid rgba(58, 126, 255, 0.2);
    border-radius: 0.75rem;
    padding: 1.25rem;
    position: relative;
}

.info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #3a7eff, #8a5fff);
    border-radius: 0.75rem 0 0 0.75rem;
}

.info-heading {
    color: rgba(255, 255, 255, 0.9);
}

/* ปรับแต่งปุ่ม */
.btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn:hover::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(100, 100);
        opacity: 0;
    }
}

.btn-primary {
    background: linear-gradient(45deg, #3a7eff, #5a94ff) !important;
    border: none !important;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(58, 126, 255, 0.3) !important;
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #20c3d0) !important;
    border: none !important;
}

.btn-info:hover {
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3) !important;
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(45deg, #dc3545, #ff5b6b) !important;
    border: none !important;
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
    transform: translateY(-2px);
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0.25rem;
}

/* ปรับแต่งตาราง */
.custom-table {
    color: #fff;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.custom-table thead th {
    background-color: #1a1f2c;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    position: sticky;
    top: 0;
    z-index: 10;
}

.custom-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.custom-table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ปรับแต่งการแสดงผลโค้ด */
code {
    background-color: rgba(0, 0, 0, 0.3);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.5px;
}

/* ปรับแต่งป้ายสถานะ */
.badge {
    padding: 0.5em 0.7em;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0.25rem;
}

.badge.bg-success {
    background: linear-gradient(45deg, #28a745, #34ce57) !important;
}

.badge.bg-warning {
    background: linear-gradient(45deg, #ffc107, #ffda65) !important;
    color: #212529 !important;
}

.badge.bg-danger {
    background: linear-gradient(45deg, #dc3545, #ff5b6b) !important;
}

.badge.bg-info {
    background: linear-gradient(45deg, #17a2b8, #20c3d0) !important;
}

/* ปรับแต่งตัวค้นหา */
.search-container {
    width: 280px;
    transition: all 0.3s ease;
}

.sortable-item {
    transition: all 0.3s ease;
}

.sortable-item:hover {
    transform: translateX(5px);
}

.sortable-ghost {
    opacity: 0.5;
}

.sortable-chosen {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* สไตล์สำหรับ status */
.border-success.bg-success.bg-opacity-10 {
    background-color: rgba(40, 167, 69, 0.1) !important;
}

.border-danger.bg-danger.bg-opacity-10 {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

.sortable-item {
    transition: all 0.3s ease;
}

.sortable-item:hover {
    transform: translateX(5px);
}

.sortable-ghost {
    opacity: 0.5;
}

.sortable-chosen {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* สไตล์สำหรับ status */
.border-success.bg-success.bg-opacity-10 {
    background-color: rgba(40, 167, 69, 0.1) !important;
}

.border-danger.bg-danger.bg-opacity-10 {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

.section-content {
    background: rgba(30, 39, 56, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sortable-item {
    transition: all 0.3s ease;
}

.sortable-item:hover {
    transform: translateX(5px);
}

.sortable-ghost {
    opacity: 0.5;
}

.sortable-chosen {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* สไตล์สำหรับ status */
.border-success.bg-success.bg-opacity-10 {
    background-color: rgba(40, 167, 69, 0.1) !important;
}

.border-danger.bg-danger.bg-opacity-10 {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

.section-content {
    background: rgba(30, 39, 56, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* เพิ่ม CSS สำหรับส่วนแสดงคีย์ที่ซื้อใหม่ */
.key-item {
    transition: all 0.3s ease;
    background-color: rgba(30, 39, 56, 0.8) !important;
}

.key-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: rgba(30, 39, 56, 1) !important;
}

.key-code {
    font-family: 'Consolas', 'Monaco', monospace;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 0.6rem;
    border-radius: 0.25rem;
    cursor: pointer;
    user-select: all;
}

.key-code:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.badge.bg-success {
    background: linear-gradient(45deg, #28a745, #34ce57) !important;
    font-weight: 500;
    font-size: 0.7rem;
    padding: 0.35em 0.65em;
}

#newly-generated-keys .col-md-6 {
    margin-bottom: 0.75rem;
}

/* การปรับการแสดงผลให้เหมาะสมกับอุปกรณ์ */
@media (max-width: 768px) {
    .search-container {
        width: 100%;
        margin-top: 1rem;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .d-flex.justify-content-between .btn {
        margin-top: 1rem;
        align-self: flex-start;
    }

    .toast-container {
        position: fixed;
        z-index: 9999;
        top: 20px;
        right: 20px;
        width: 320px;
    }
    
    .toast-notification {
        display: flex;
        align-items: center;
        background: #1e1e2d;
        color: #e4e6ef;
        margin-bottom: 10px;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
        transform: translateX(120%);
        transition: transform 0.3s ease-out;
        border-left: 4px solid #3699ff;
        opacity: 0;
    }
    
    .toast-notification.show {
        transform: translateX(0);
        opacity: 1;
    }
    
    .toast-notification.success {
        border-left-color: #0bb783;
    }
    
    .toast-notification.error {
        border-left-color: #f64e60;
    }
    
    .toast-notification.warning {
        border-left-color: #ffa800;
    }
    
    .toast-notification.info {
        border-left-color: #3699ff;
    }
    
    .toast-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        margin-right: 15px;
        flex-shrink: 0;
    }
    
    .toast-icon.success {
        color: #0bb783;
    }
    
    .toast-icon.error {
        color: #f64e60;
    }
    
    .toast-icon.warning {
        color: #ffa800;
    }
    
    .toast-icon.info {
        color: #3699ff;
    }
    
    .toast-content {
        flex-grow: 1;
    }
    
    .toast-title {
        font-weight: 600;
        margin-bottom: 5px;
        color: #ffffff;
    }
    
    .toast-message {
        font-size: 0.9rem;
        opacity: 0.9;
    }
    
    .toast-close {
        background: transparent;
        border: none;
        color: #92929f;
        cursor: pointer;
        font-size: 16px;
        margin-left: 10px;
        padding: 0;
        transition: color 0.2s;
    }
    
    .toast-close:hover {
        color: #ffffff;
    }
    
    .toast-progress {
        position: absolute;
        bottom: 0;
        left: 0;
        height: 3px;
        width: 100%;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 0 0 8px 8px;
        overflow: hidden;
    }
    
    .toast-progress-bar {
        height: 100%;
        width: 100%;
        transform-origin: left;
        background: rgba(54, 153, 255, 0.6);
        animation: progress-shrink 3s linear forwards;
    }
    
    .toast-notification.success .toast-progress-bar {
        background: rgba(11, 183, 131, 0.6);
    }
    
    .toast-notification.error .toast-progress-bar {
        background: rgba(246, 78, 96, 0.6);
    }
    
    .toast-notification.warning .toast-progress-bar {
        background: rgba(255, 168, 0, 0.6);
    }
    
    .toast-notification.info .toast-progress-bar {
        background: rgba(54, 153, 255, 0.6);
    }
    
    @keyframes progress-shrink {
        0% {
            transform: scaleX(1);
        }
        100% {
            transform: scaleX(0);
        }
    }
    
    /* ====== Custom Confirmation Dialog (Dark Theme) ====== */
    
    .dialog-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }
    
    .dialog-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    .dialog-container {
        background-color: #1e1e2d;
        border-radius: 8px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        width: 90%;
        max-width: 400px;
        padding: 20px;
        transform: scale(0.8);
        opacity: 0;
        transition: transform 0.3s, opacity 0.3s;
        border: 1px solid #32324a;
    }
    
    .dialog-overlay.show .dialog-container {
        transform: scale(1);
        opacity: 1;
    }
    
    .dialog-header {
        display: flex;
        align-items: center;
        margin-bottom: 15px;
    }
    
    .dialog-icon {
        width: 32px;
        height: 32px;
        margin-right: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .dialog-icon.question {
        color: #8950fc;
    }
    
    .dialog-icon.warning {
        color: #ffa800;
    }
    
    .dialog-title {
        color: #ffffff;
        font-weight: 600;
        font-size: 1.2rem;
        margin: 0;
    }
    
    .dialog-content {
        color: #92929f;
        margin-bottom: 20px;
        font-size: 0.95rem;
    }
    
    .dialog-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
    }
    
    .dialog-btn {
        padding: 8px 16px;
        border-radius: 6px;
        font-weight: 500;
        border: none;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .dialog-btn-cancel {
        background-color: #474761;
        color: #ffffff;
    }
    
    .dialog-btn-cancel:hover {
        background-color: #303046;
    }
    
    .dialog-btn-confirm {
        background-color: #3699ff;
        color: #ffffff;
    }
    
    .dialog-btn-confirm:hover {
        background-color: #187de4;
    }
    
    .dialog-btn-danger {
        background-color: #f64e60;
        color: #ffffff;
    }
    
    .dialog-btn-danger:hover {
        background-color: #ee2d41;
    }
}