/* IMSB Ad Copy Generator - Fresh & Professional Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #6c5ce7;
    --primary-hover: #5b4cc4;
    --secondary-color: #00b894;
    --accent-color: #00d2d3;
    --bg-main: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border-color: #dfe6e9;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.08);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

.imsb-admin-wrap {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
}

/* Header Section */
.imsb-header {
    background: var(--card-bg);
    padding: 30px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 6px solid var(--primary-color);
}

.imsb-header-text h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #1a1a1a;
}

.imsb-header-text p {
    margin: 5px 0 0;
    font-size: 15px;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Main Card */
.imsb-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.imsb-card h3 {
    margin-top: 0;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1.5px solid var(--border-color);
    color: #333;
}

/* Form Layout - 2 Columns */
#imsb-generator-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 25px 40px;
}

.imsb-form-group {
    display: flex;
    flex-direction: column;
}

.form-full-width {
    grid-column: span 2;
}

.imsb-form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
}

.imsb-form-group input,
.imsb-form-group select,
.imsb-form-group textarea {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fbfbfc;
}

.imsb-form-group input:focus,
.imsb-form-group select:focus,
.imsb-form-group textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(46, 134, 222, 0.1);
    outline: none;
    background: #fff;
}

.imsb-form-footer {
    grid-column: span 2;
    margin-top: 20px;
}

.button-generate {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    color: white !important;
    border: none !important;
    padding: 16px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    border-radius: var(--radius-md) !important;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.button-generate.is-loading {
    cursor: wait;
    opacity: 0.9;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.imsb-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: imsb-spin 0.8s linear infinite;
}

@keyframes imsb-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Output Section */
#imsb-output-container {
    margin-top: 50px;
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.imsb-output-box {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.imsb-output-box h4 {
    margin: 0 0 25px;
    font-size: 19px;
    font-weight: 800;
    color: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Social Tabs Refined */
.social-tabs {
    display: inline-flex;
    background: #f1f2f6;
    padding: 5px;
    border-radius: 30px;
    margin-bottom: 25px;
}

.social-tab {
    padding: 10px 25px;
    border-radius: 25px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.3s;
}

.social-tab.active {
    background: #fff;
    color: var(--accent-color);
    box-shadow: var(--shadow-sm);
}

.output-content textarea {
    width: 100%;
    height: 320px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 24px;
    font-size: 15px;
    background: #fcfcfd;
    line-height: 1.8;
    color: var(--text-main);
    resize: none;
    margin-bottom: 0;
    display: block;
    outline: none;
    transition: border-color 0.3s;
    font-family: inherit;
}

.output-content textarea:focus {
    border-color: var(--accent-color);
    background: #fff;
}

.social-footer {
    padding-top: 15px;
    text-align: right;
}

/* Variations List Refined */
.list-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1.5px solid #f9fafb;
    transition: all 0.2s;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
}

.list-item:hover {
    background: #f8faff;
    transform: scale(1.005);
}

.item-num {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 15px;
}

.item-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    margin-right: 20px;
}

.copy-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.copy-btn.success {
    background: var(--secondary-color) !important;
    color: #fff !important;
    border-color: var(--secondary-color) !important;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Settings Page Aesthetics */
.imsb-settings-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1.5px solid var(--border-color);
}

#imsb-test-connection {
    background: #fff !important;
    color: var(--text-muted) !important;
    border: 1.5px solid var(--border-color) !important;
    font-weight: 600 !important;
    border-radius: var(--radius-md) !important;
}

#imsb-test-connection:hover {
    background: #f1f2f6 !important;
    color: #333 !important;
}

.spinner {
    margin: 30px auto !important;
}

.imsb-view-btn {
    background: #fff !important;
    color: var(--accent-color) !important;
    border: 1.5px solid var(--accent-color) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 700 !important;
    padding: 6px 15px !important;
}

.imsb-view-btn:hover {
    background: var(--accent-color) !important;
    color: #fff !important;
}

/* Modal System */
.imsb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.imsb-modal-container {
    background: var(--bg-main);
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.imsb-modal-header {
    background: #fff;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.imsb-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.close-modal {
    background: #f1f2f6;
    border: none;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    transition: all 0.2s;
}

.close-modal:hover {
    background: var(--primary-color);
    color: #fff;
}

.imsb-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal specific overrides */
.imsb-modal-body .imsb-output-box {
    margin-bottom: 25px;
}