/* GLOBAL NAV MENU */
.wpiko-chatbot-admin-container {
    display: flex;
    flex-direction: row;
    margin-top: 0;
}

/* Adjust margin when header is present */
.wpiko-chatbot-plugin-header+.wrap .wpiko-chatbot-admin-container {
    margin-top: 16px;
}

.wpiko-chatbot-nav {
    width: 200px;
    margin-right: 15px;
}

.wpiko-chatbot-nav ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

.wpiko-chatbot-nav li {
    margin-bottom: 5px;
}

.wpiko-chatbot-nav a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #333;
    background-color: white;
    border-radius: 5px;
}

.wpiko-chatbot-nav a:hover,
.wpiko-chatbot-nav a.nav-tab-active {
    background: #0968fe;
    color: #fff;
}

.wpiko-chatbot-content {
    flex-grow: 1;
    max-width: calc(100% - 220px);
}

/* Mobile Navigation Toggle */
.wpiko-mobile-nav-toggle {
    display: none;
    background: white;
    color: #333;
    border: 1px solid #e1e5e9;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 15px;
    width: 100%;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
    outline: none;
}

.wpiko-mobile-nav-toggle:hover,
.wpiko-mobile-nav-toggle:focus {
    background: #f8f9fa;
    border-color: #0968fe;
    box-shadow: 0 0 0 2px rgba(9, 104, 254, 0.3);
}

.wpiko-mobile-nav-toggle .dashicons {
    margin-right: 8px;
    vertical-align: middle;
}

.wpiko-mobile-nav-toggle .nav-arrow {
    float: right;
    transition: transform 0.3s ease;
    margin-top: 2px;
}

.wpiko-mobile-nav-toggle.active .nav-arrow {
    transform: rotate(180deg);
}

/* Current Tab Display for Mobile */
.wpiko-current-tab {
    display: none;
    color: #0968fe;
    font-weight: 500;
    margin-right: 8px;
}

/* Responsive design for smaller screens */
@media screen and (max-width: 782px) {
    .wpiko-chatbot-admin-container {
        flex-direction: column;
    }

    .wpiko-chatbot-nav {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
        position: relative;
    }

    .wpiko-chatbot-content {
        max-width: 100%;
    }

    /* Show mobile toggle button */
    .wpiko-mobile-nav-toggle {
        display: block;
    }

    .wpiko-current-tab {
        display: inline;
    }

    /* Hide navigation by default on mobile */
    .wpiko-chatbot-nav ul {
        display: none;
        background: white;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        padding: 10px;
        margin-top: 10px;
        border: 1px solid #e1e5e9;
        position: relative;
        z-index: 1000;
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Show navigation when active */
    .wpiko-chatbot-nav.nav-open ul {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    /* Smooth animation for dropdown */
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Adjust nav items for mobile */
    .wpiko-chatbot-nav li {
        margin-bottom: 8px;
    }

    .wpiko-chatbot-nav li:last-child {
        margin-bottom: 0;
    }

    .wpiko-chatbot-nav a {
        padding: 12px 15px;
        font-size: 14px;
        border-radius: 6px;
        transition: all 0.2s ease;
        border: 1px solid transparent;
    }

    .wpiko-chatbot-nav a:hover {
        background: #f8f9fa;
        border-color: #0968fe;
        color: #0968fe;
    }

    .wpiko-chatbot-nav a.nav-tab-active {
        background: #0968fe;
        color: white;
        border-color: #0968fe;
    }

    .wpiko-chatbot-nav a .dashicons {
        margin-right: 8px;
        font-size: 16px;
        width: 16px;
        height: 16px;
    }

    /* Close mobile nav overlay */
    .wpiko-chatbot-nav.nav-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.1);
        z-index: 999;
        display: none;
        /* We don't want overlay for admin pages */
    }
}

/* Extra small screens */
@media screen and (max-width: 480px) {
    .wpiko-mobile-nav-toggle {
        padding: 10px 15px;
        font-size: 13px;
    }

    .wpiko-current-tab {
        font-size: 13px;
    }

    .wpiko-chatbot-nav a {
        padding: 10px 12px;
        font-size: 13px;
    }

    .wpiko-chatbot-nav a .dashicons {
        font-size: 14px;
        margin-right: 6px;
        width: 14px;
        height: 14px;
    }

    .wpiko-chatbot-nav ul {
        max-height: 60vh;
    }
}

/* Nav Menu Icons */
.wpiko-chatbot-nav ul li a {
    display: flex;
    align-items: center;
}

.wpiko-chatbot-nav ul li a .dashicons {
    margin-right: 5px;
}

/* GLOBAL BUTTONS */
.wrap h2.nav-tab-wrapper {
    border-bottom: none;
}

.wp-core-ui .button-primary {
    background: #0968fe;
    color: white !important;
    border: none !important;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 24px;
    letter-spacing: 0.5px;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.wp-core-ui .button-primary:hover {
    background: #0755d6;
    transform: translateY(-1px);
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(3, 181, 170, 0.15);
}

.wp-core-ui .button {
    color: #333;
    border: 1px solid #333;
    letter-spacing: 0.2px;
    border-radius: 5px;
}

.wp-core-ui .button:hover {
    color: #333;
    border: 1px solid #333;
}

/* GLOBAL */
.form-table {
    background: white;
    border-radius: 5px;
}

.form-table td {
    border-top: solid 1px #f1f1f1;
    border-bottom: solid 1px #f1f1f1;
}

.form-table th {
    width: 220px;
    padding-left: 10px !important;
    border-bottom: solid 1px #f1f1f1;
    border-top: solid 1px #f1f1f1;
    border-right: solid 1px #f1f1f1;
}

.description {
    font-style: italic;
    font-size: 14px !important;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 25em;
    max-width: 100%;
    margin-bottom: 5px;
    border: 1px solid rgba(58, 79, 102, 0.2);
    color: #3A4F66;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus,
.form-table input[type="color"]:focus,
select:focus {
    border-color: #0968fe;
    outline: none;
    box-shadow: 0 0 0 2px rgba(9, 104, 254, 0.1);
}

.form-table input[type="color"] {
    width: 60px;
    height: 30px;
    vertical-align: middle;
    border: 1px solid rgba(58, 79, 102, 0.2);
}

input[type="checkbox"] {
    border: 1px solid rgba(58, 79, 102, 0.2);
    color: #3A4F66;
}

input[type="checkbox"]:focus {
    border-color: #0968fe;
    outline: none;
    box-shadow: 0 0 0 2px rgba(9, 104, 254, 0.1);
}

.wpiko-chatbot-content .notice-success,
.wpiko-chatbot-content div.updated {
    border-left-color: #03B5AA;
}

/* Switch Styling */
.wpiko-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.wpiko-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wpiko-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.wpiko-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

.wpiko-switch input:checked+.wpiko-slider {
    background-color: #0968fe;
}

.wpiko-switch input:focus+.wpiko-slider {
    box-shadow: 0 0 1px #0968fe;
}

.wpiko-switch input:checked+.wpiko-slider:before {
    transform: translateX(26px);
}

.wpiko-slider.round {
    border-radius: 34px;
}

.wpiko-slider.round:before {
    border-radius: 50%;
}

/* Form Fields Styling */
.form-table input[type="text"],
.form-table select,
textarea.large-text {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(58, 79, 102, 0.2);
    background: white;
    color: #3A4F66;
    transition: all 0.2s ease;
}

/* Fix dropdown arrows for form table selects */
.form-table select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230968fe' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-table input[type="text"]:focus,
.form-table select:focus,
textarea.large-text:focus {
    border-color: #0968fe;
    outline: none;
    box-shadow: 0 0 0 2px rgba(9, 104, 254, 0.1);
}

.form-table .description {
    color: #3A4F66;
    opacity: 0.8;
    font-size: 13px;
    margin-top: 8px;
}

/* Header Styles */
.wpiko-chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.wpiko-chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.wpiko-chatbot-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.wpiko-chatbot-header-left h1 {
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
}

.wpiko-chatbot-header-right {
    display: flex;
    gap: 20px;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #666;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.header-link:hover {
    color: #0968FE;
    background: rgba(9, 104, 254, 0.05);
}

.header-pro-link {
    background-color: #0968FE;
    color: white;
    font-weight: 500;
}

.header-pro-link:hover {
    background-color: #0753cc;
    color: white;
}

.header-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

@media screen and (max-width: 768px) {
    .wpiko-chatbot-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .wpiko-chatbot-header-right {
        flex-wrap: wrap;
        justify-content: center;
    }
}


/* TAB - API KEY */
.api-key-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(58, 79, 102, 0.08);
}

.button-link-delete {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    padding: 7px 14px !important;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease;
    display: inline-flex !important;
    align-items: center;
}

.button-link-delete .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
}

.button-link-delete:hover {
    background: #dc3545 !important;
    color: white !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

/* TAB - FLOATING CHATBOT  */
.floating-chatbot-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(58, 79, 102, 0.08);
}

/* TAB - SHORTCODE CHATBOT  */
.shortcode-chatbot-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(58, 79, 102, 0.08);
}

/* TAB - CHATBOT STYLE */
.style-settings-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(58, 79, 102, 0.08);
}

#advanced-options {
    border-radius: 5px;
}

/* Upload Button */
.style-settings-section #upload-btn.button {
    background: #ffffff !important;
    border: 1px solid #0968fe !important;
    color: #0968fe;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.style-settings-section #upload-btn.button:hover {
    background: #0756d6 !important;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(9, 104, 254, 0.15);
}

/* Advanced Options Buttons */
#toggle-advanced-options {
    background: #0968fe !important;
    border: none !important;
    color: #ffffff;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-right: 12px;
    line-height: 1.4;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(9, 104, 254, 0.1);
}

#toggle-advanced-options:hover {
    box-shadow: 0 4px 15px rgba(9, 104, 254, 0.2);
    background: #0756d6 !important;
}

#reset-advanced-options {
    background: #F6F8F9 !important;
    border: 1px solid #f1f1f1 !important;
    color: #3A4F66;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-right: 10px;
    line-height: 1.4;
    font-size: 13px;
    cursor: pointer;
}

#reset-advanced-options:hover {
    background: #f8fafc !important;
    border-color: #3A4F66 !important;
    box-shadow: 0 4px 12px rgba(58, 79, 102, 0.08);
}

/* TAB - CHATBOT MENU */
.chatbot-menu-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(58, 79, 102, 0.08);
}

/* TAB - QUESTIONS */
.pre-made-questions-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(58, 79, 102, 0.08);
}

.question-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.question-row input[type="text"] {
    flex-grow: 1;
    margin-right: 10px;
}

#add-question.button {
    background: #ffffff !important;
    border: 1px solid #0968fe !important;
    color: #0968fe;
    padding: 10px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#add-question.button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
}

#add-question.button:hover {
    background: #0756d6 !important;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(9, 104, 254, 0.15);
}

.pre-made-questions-section .button.remove-question {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    padding: 7px 14px !important;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease;
    gap: 5px;
}

.pre-made-questions-section .button.remove-question:hover {
    background: #dc3545 !important;
    color: white !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

/* TAB - ERROR MESSAGES */
.error-messages-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(58, 79, 102, 0.08);
}

.error-messages-section input[type="text"] {
    width: 100%;
}


/* GLOBAL ACCORDION STYLES */
.wpiko-accordion-item {
    margin-top: 20px;
    margin-bottom: 20px;
    border: none;
    border-radius: 8px;
    background: #f8fafc;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.collapsible-header {
    background: #f8fafc;
    border: none;
    padding: 15px 5px 15px 20px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #334155;
    font-size: 14px;
    transition: all 0.2s ease;
}

.collapsible-header:hover {
    background: #eff6ff;
    color: #0968FE;
}

.collapsible-header .dashicons-arrow-down-alt2 {
    transition: transform 0.3s ease;
    color: #94a3b8;
    margin-right: 15px;
    padding: 0;
    width: 20px;
    height: 20px;
    text-align: center;
}

.collapsible-header.active .dashicons-arrow-down-alt2 {
    transform: rotate(180deg);
    color: #0968FE;
}

.collapsible-header span:first-child .dashicons {
    margin-right: 12px;
    color: #0968FE;
}

.collapsible-content {
    display: none;
    padding: 25px;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    background: #fff;
    margin: 0 1px 1px 1px;
    border-radius: 0 0 8px 8px;
}

.collapsible-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.collapsible-content .form-table {
    margin-top: 0;
    background: transparent;
    border: none;
}

.collapsible-content .form-table th {
    padding-left: 0;
    width: 200px;
    color: #475569;
    font-weight: 500;
}

.collapsible-content .form-table td {
    padding-bottom: 20px;
}