/* ============================================
   LOADING SPINNER STYLES
   ============================================ */
#loading-center .loader,
.loader {
    width: 48px;
    height: 48px;
    border: 3px solid #FFF;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

#loading-center .loader::after,
.loader::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: #FF3D00;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* CSChatThaiUI Font Family */
@font-face {
    font-family: 'CSChatThaiUI';
    src: url('../fonts/CSChatThaiUI.woff2') format('woff2'),
         url('../fonts/CSChatThaiUI.woff') format('woff'),
         url('../fonts/CSChatThaiUI.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'CSChatThaiUI';
    src: url('../fonts/CSChatThaiUI-Light.woff2') format('woff2'),
         url('../fonts/CSChatThaiUI-Light.woff') format('woff'),
         url('../fonts/CSChatThaiUI-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'CSChatThaiUI';
    src: url('../fonts/CSChatThaiUI-Bold.woff2') format('woff2'),
         url('../fonts/CSChatThaiUI-Bold.woff') format('woff'),
         url('../fonts/CSChatThaiUI-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Apply Plus Jakarta Sans as primary font with CSChatThaiUI as fallback for Thai */
body {
    font-family: 'Plus Jakarta Sans', 'CSChatThaiUI', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Override all text elements */
h1, h2, h3, h4, h5, h6,
p, span, a, li, div,
button, input, textarea, select,
.btn, .form-control, .form-label {
    font-family: 'Plus Jakarta Sans', 'CSChatThaiUI', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Override theme font classes */
.font--jakarta,
.font--rubik,
.font--inter {
    font-family: 'Plus Jakarta Sans', 'CSChatThaiUI', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* ============================================
   HEADER MENU STYLES
   ============================================ */
.sub-menu .title {
    display: block;
    font-weight: 600;
    font-size: 14px;
}

.sub-menu .desc {
    display: block;
    font-size: 12px;
    color: #999;
    font-weight: 400;
    margin-top: 2px;
}

/* Fix sub-menu overflow for last items */
.wsmenu-list > li:last-child .sub-menu,
.wsmenu-list > li:nth-last-child(2) .sub-menu {
    left: auto !important;
    right: 0 !important;
}

/* ============================================
   CODE EDITOR STYLES
   ============================================ */

/* SweetAlert2 Custom Styles */
.swal2-popup {
    font-size: 0.9rem !important;
}

.swal2-title {
    font-size: 1.3rem !important;
    font-weight: 600 !important;
}

.swal2-html-container {
    font-size: 0.85rem !important;
}

.swal2-confirm,
.swal2-cancel {
    font-size: 0.85rem !important;
    padding: 8px 20px !important;
}

.swal2-icon {
    width: 4rem !important;
    height: 4rem !important;
}

.swal2-icon .swal2-icon-content {
    font-size: 2.5rem !important;
}

/* ============================================
   CODE EDITOR STYLES
   ============================================ */
.code-editor-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.code-editor-container .row {
    position: relative;
}

.code-editor-container .row::after {
    content: "";
    display: table;
    clear: both;
}

.editor-panel {
    height: calc(100vh - 250px);
    min-height: 600px;
    width: 50%;
    float: left;
    position: relative;
    z-index: 1;
}

.preview-panel {
    height: calc(100vh - 250px);
    min-height: 600px;
    width: 50%;
    float: left;
    position: relative;
    border-left: 1px solid #e0e0e0;
    z-index: 1;
}

/* Resizer */
.resizer {
    width: 5px;
    height: calc(100vh - 250px);
    min-height: 600px;
    background: #e0e0e0;
    cursor: col-resize;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    transition: background 0.2s;
}

.resizer:hover {
    background: var(--secondary-color);
}

.resizer:active {
    background: var(--primary-color);
}

.editor-tabs {
    background: #2c3e50;
    border: none;
    padding: 0;
    margin: 0;
    height: 51.35px;
}

.editor-tabs .nav-link {
    color: #fff;
    border: none;
    padding: 12px 20px;
    font-size: 0.8rem;
    background: transparent;
    border-radius: 0;
    display: inline-flex;
    gap: 6px;
}

.editor-tabs .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.editor-tabs .nav-link.active {
    color: white;
    background: #34495e;
}

.editor-tabs .nav-link span[class^="flaticon-"] {
    font-size: 0.85rem;
    line-height: 1;
    display: inline-block;
}

.editor-tabs .btn {
    margin: 8px 8px 3px 0px;
    padding: 4px 16px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.editor-tabs .btn span[class^="flaticon-"] {
    font-size: 0.85rem;
    line-height: 1;
    display: inline-block;
}

.editor-content {
    height: calc(100% - 48px);
}

.editor-content .tab-pane {
    height: 100%;
}

/* ACE Editor container */
#htmlCode,
#cssCode,
#jsCode {
    height: 100% !important;
    width: 100% !important;
    position: relative;
}

/* Fix font issue for Ace Editor - force monospace */
.ace_editor,
.ace_editor * {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace !important;
}

/* Ensure proper line height for Thai characters */
.ace_editor .ace_text-layer {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace !important;
}

.ace_editor .ace_line {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace !important;
}

.preview-header {
    background: #34495e;
    color: white;
    padding: 12px 20px;
    height: 51.35px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.preview-header h5 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    gap: 8px;
    color: white;
}

.preview-header span[class^="flaticon-"] {
    font-size: 0.85rem;
    line-height: 1;
    display: inline-block;
}

.preview-content {
    height: calc(100% - 48px);
    background: white;
}

.preview-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Responsive */
@media (max-width: 991px) {
    .editor-panel {
        height: 400px;
        width: 100% !important;
        float: none;
    }

    .preview-panel {
        height: 400px;
        width: 100% !important;
        float: none;
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }

    .resizer {
        display: none;
    }
}

/* Documentation Section */
.doc-section {
    margin-bottom: 40px;
}

.doc-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.doc-intro {
    font-size: 16px;
    color: #666;
    line-height: 1.75;
    margin-bottom: 0;
}

.doc-heading {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    margin-top: 0;
}

.doc-subheading {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-top: 25px;
    margin-bottom: 10px;
}

.doc-section p {
    font-size: 15px;
    color: #666;
    line-height: 1.75;
    margin-bottom: 15px;
}

.doc-list {
    list-style: none;
    padding-left: 20px;
    margin-bottom: 20px;
}

.doc-list li {
    padding: 5px 0;
    padding-left: 22px;
    position: relative;
    font-size: 15px;
    color: #666;
    line-height: 1.75;
}

.doc-list li:before {
    content: "•";
    position: absolute;
    left: 0px;
    top: 10px;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 0.5;
}

.doc-section code {
    background: #f8f9fa;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 14px;
    color: #d63384;
    border: 1px solid #e9ecef;
}

.doc-section .sub_paragraph {
    padding-left: 20px;
}

.doc-code-example {
    margin-top: 25px;
}

.doc-code-example pre {
    background: #282c34;
    color: #abb2bf;
    padding: 25px;
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 15px;
    border: 1px solid #21252b;
}

.doc-code-example pre code {
    background: transparent;
    color: #abb2bf;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    border: none;
}

@media (max-width: 768px) {
    .doc-title {
        font-size: 1.75rem;
    }

    .doc-heading {
        font-size: 1.25rem;
    }

    .doc-section p,
    .doc-list li {
        font-size: 14px;
    }
}

/* ============================================
   IMAGE METADATA EDITOR STYLES
   ============================================ */
.footer {
  padding-bottom: 12px;
}
.footer hr {
  margin-top: 0px;
  margin-bottom: 12px;
}
p {
  font-size: 0.8rem;
}
p.p-sm {
  font-size: 0.8rem;
}
p.p-lg {
  font-size: 0.9rem;
}

/* CSS Variables */
:root {
    --primary-color: #ff4c87;
    --secondary-color: #6a58f7;
    --dark-color: #1e1e2f;
    --light-bg: #f8f9fa;
}

/* Flaticon Size Adjustments */
.header-section h1 span[class^="flaticon-"]:before,
.header-section h1 span[class*=" flaticon-"]:before {
    font-size: 3.5rem !important;
}

.header-section h1 span[class^="flaticon-"],
.header-section h1 span[class*=" flaticon-"] {
    margin-right: 15px;
    vertical-align: middle;
    display: inline-block;
}

.card-header h3 span[class^="flaticon-"]:before,
.card-header h3 span[class*=" flaticon-"]:before {
    font-size: 1.8rem !important;
    color: var(--secondary-color);
}

.card-header h3 span[class^="flaticon-"],
.card-header h3 span[class*=" flaticon-"] {
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
    color: var(--secondary-color);
}

/* Form Labels from contacts.html style */
.contact-form p.p-lg {
    font-weight: 600;
    margin-bottom: 0px;
}

.contact-form > div > span {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
}
.contact-form .form-control, .contact-form .form-select {
  font-size: 0.8rem;
}
/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header Section */
.header-section {
    text-align: center;
    margin-bottom: 40px;
}

.header-section h1 {
    font-weight: 700;
    font-size: 2.3rem;
    margin-bottom: 15px;
}

.header-section p {
    font-size: 1rem;
    color: #666;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

/* Card Styles */
.card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.card-header {
    background: #f8f9fa;
    color: #333;
    border-radius: 15px 15px 0 0 !important;
    padding: 20px;
    border: none;
    border-bottom: 2px solid #e0e0e0;
}

.card-header h3 {
    margin: 0;
    font-weight: 600;
    font-size: 1.4rem;
}

.card-body {
    padding: 30px;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #fff;
}

.upload-area.dragover {
    border-color: var(--secondary-color);
    background: #e3f2fd;
}

.upload-icon:before {
    font-size: 6rem !important;
    color: var(--secondary-color);
}

.upload-icon {
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: inline-block;
}

/* Form Styles */
.form-holder {
    background: white;
}

.contact-form .form-control,
.contact-form .form-select {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.contact-form .form-control:focus,
.contact-form .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(106, 88, 247, 0.15);
}

/* Button Styles */
.form-btn .btn {
    border-radius: 8px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s;
    border: none;
}

.btn--theme {
    color: white;
}

.btn--theme:hover,
.hover--theme:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Image Card */
.image-card {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 15px;
    background: white;
    transition: all 0.3s;
}

.image-card:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.image-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.image-card .remove-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 76, 135, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
span[class^="flaticon-cancel"]::before{
    font-size: 0.5rem !important;
}
.image-card .remove-btn span {
    font-size: 0.5rem !important;
    line-height: 1;
}

.image-card .remove-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.image-card .file-name {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading Process */
#loadingProcess {
    display: none;
}

.spinner-border {
    width: 24px;
    height: 24px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-section h1 {
        font-size: 1.8rem;
    }

    .card-body {
        padding: 20px;
    }
}

/* ============================================
   TOAST NOTIFICATION STYLES
   ============================================ */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification i {
    font-size: 18px;
}

/* ============================================
   CONFIRM MODAL STYLES
   ============================================ */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.confirm-modal.active {
    display: flex;
}

.confirm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.confirm-modal-container {
    position: relative;
    z-index: 1;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.confirm-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.confirm-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal-icon svg {
    width: 32px;
    height: 32px;
    stroke: #dc2626;
}

.confirm-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin: 0 0 0.5rem 0;
}

.confirm-modal-message {
    font-size: 16px;
    color: #666;
    margin: 0 0 2rem 0;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
}

.confirm-modal-actions .btn-cancel,
.confirm-modal-actions .btn-confirm {
    flex: 1;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.confirm-modal-actions .btn-cancel {
    background: #f3f4f5;
    color: #666;
}

.confirm-modal-actions .btn-cancel:hover {
    background: #e0e0e0;
    color: #333;
}

.confirm-modal-actions .btn-confirm {
    background: #dc2626;
    color: white;
}

.confirm-modal-actions .btn-confirm:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
