/**
 * Plugin Name: Zeal Ad Manager
 * Author:      Edu Brazeal
 * Author URI:  https://edubrazeal.com
 * Version:     1.0.0
 */

/**
 * TABLE OF CONTENTS
 * --------------------------------------------------------------------------
 * 1.0 - General Layout & Structure
 * 2.0 - Navigation
 * 2.1 - Desktop Navigation
 * 2.2 - Mobile Sticky Navigation
 * 3.0 - Cards & Content Panels
 * 4.0 - Forms, Fields & Buttons
 * 5.0 - Tables
 * 8.0 - Modals & Popups
 * 8.1 - General Modal Styles
 * 8.2 - Modal Content (Budget, Ad Code)
 * 9.0 - Components
 * 9.1 - Notifications
 * 9.2 - Action Menu Dropdown
 * 9.3 - Sponsored Tooltip
 * 9.4 - Login Form Wrapper
 * 9.5 - Registration Form
 * 9.6 - Utility Classes
 * 9.7 - Publisher Earnings Components
 * 9.8 - AI Keyword Generator
 * 9.9 - AI Content Refinement
 * 9.10 - App Creative Selector
 * 10.0 - Responsive Design
 * 10.1 - Tablet & Small Desktop
 * 10.2 - Mobile Devices
 * --------------------------------------------------------------------------
 */


/* --- 1.0 - General Layout & Structure --- */
.zam-dashboard-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
@media (min-width: 1024px) {
    .zam-dashboard-wrapper {
    }
}
.zeal-ad-unit.zam-ad-template-html {
    width: 300px;
}

/* --- 2.0 - Navigation --- */
.zam-dashboard-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.zam-dashboard-nav ul li a {
    display: block;
    padding: 14px 18px;
    text-decoration: none;
    color: #4b5563;
    border-radius: 8px;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.zam-dashboard-nav ul li a:hover {
    background-color: #f3f4f6;
    color: #1f2937;
    transform: translateX(2px);
}

.zam-dashboard-nav ul li.zam-is-active a {
    background-color: #ef0606;
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 6, 6, 0.25);
}

/* --- 2.1 - Desktop Navigation --- */
@media screen and (min-width: 783px) {
    .zam-dashboard-nav {
        background-color: #ffffff;
        border: 1px solid #e5e7eb;
        padding: 24px;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    .zam-dashboard-nav ul li a {
        display: flex;
        align-items: center;
    }
    .zam-dashboard-nav .dashicons {
        margin-right: 10px;
        font-size: 20px;
        height: 20px;
        width: 20px;
    }
}

/* --- 2.2 - Mobile Sticky Navigation --- */
@media screen and (max-width: 782px) {
    .zam-dashboard-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
        z-index: 1000;
        padding: 8px 0;
        border-radius: 0;
        border-right: none;
        border-left: none;
        border-bottom: none;
    }
    .zam-dashboard-nav ul {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    .zam-dashboard-nav ul li {
        flex: 1;
        text-align: center;
    }
    .zam-dashboard-nav ul li a {
        padding: 10px 5px;
        margin-bottom: 0;
        border-radius: 0;
        background-color: transparent !important;
        color: #6b7280;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .zam-dashboard-nav ul li.zam-is-active a {
        color: #ef0606;
    }
    .zam-dashboard-nav .zam-nav-label {
        display: none;
    }
    .zam-dashboard-nav .dashicons {
        font-size: 28px;
        width: auto;
        height: auto;
    }
}


/* --- 3.0 - Cards & Content Panels --- */
.zam-dashboard-content {
    padding: 1px;
}

.zam-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.zam-card h2, .zam-card h3 {
    margin-top: 0;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 16px;
    margin-bottom: 24px;
    color: #1f2937;
    font-weight: 600;
}

.zam-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 16px;
    margin-bottom: 24px;
}
.zam-card-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

.zam-create-ad-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 32px;
}

.zam-form-main-column,
.zam-ad-preview-area {
    min-width: 0;
}

.zam-ad-preview-area {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.zam-ad-preview-area h3 {
    text-align: center;
    color: #4b5563;
    font-size: 16px;
    font-weight: 600;
}


/* --- 4.0 - Forms, Fields & Buttons --- */
.zam-form .zam-form-row {
    margin-bottom: 24px;
}

.zam-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
}

.zam-form label.zam-checkbox-label {
    display: inline-block;
    margin-right: 16px;
    font-weight: 400;
}

.zam-form input[type="text"],
.zam-form input[type="url"],
.zam-form input[type="number"],
.zam-form input[type="file"],
.zam-form input[type="date"],
.zam-form select,
.zam-form textarea {
    width: 100%;
    max-width: 450px;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 15px;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.zam-form input[type="text"]:focus,
.zam-form input[type="url"]:focus,
.zam-form input[type="number"]:focus,
.zam-form input[type="date"]:focus,
.zam-form select:focus,
.zam-form textarea:focus {
    outline: none;
    border-color: #ef0606;
    box-shadow: 0 0 0 3px rgba(239, 6, 6, 0.1);
}

.zam-form textarea {
    max-width: 100%;
    resize: vertical;
}

.zam-checkbox-grid {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.zam-form .zam-form-description {
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.5;
}

.zam-date-fields {
    display: flex;
    gap: 20px;
}

.zam-date-fields > div {
    flex: 1;
}

.zam-date-fields input[type="date"] {
    max-width: 100%;
}

.zam-button {
    background-color: #ef0606;
    color: #fff;
    border: none;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.zam-button.zam-submit-button {
    margin-top: 24px;
}

.zam-button:hover {
    background-color: #d10505;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 6, 6, 0.25);
}

.zam-button:active {
    transform: translateY(0);
}

.zam-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.zam-button-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    font-weight: 500;
}

.zam-button-secondary:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
    color: #1f2937;
}


/* --- 5.0 - Tables --- */
.zam-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.zam-table th,
.zam-table td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.zam-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.zam-table tbody tr {
    transition: background-color 0.15s ease;
}

.zam-table tbody tr:hover {
    background-color: #f9fafb;
}

.zam-table .zam-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
}

.zam-table .status-pending,
.zam-table .status-draft { 
    background-color: #fef3c7; 
    color: #92400e; 
}

.zam-table .status-active,
.zam-table .status-publish { 
    background-color: #d1fae5; 
    color: #065f46; 
}

.zam-table .status-rejected,
.zam-table .status-exhausted { 
    background-color: #fee2e2; 
    color: #991b1b; 
}


/* --- 8.0 - Modals & Popups --- */
/* --- 8.1 - General Modal Styles --- */
.zam-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.25s ease;
    backdrop-filter: blur(2px);
}

.zam-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 32px;
    border: none;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    animation: slideIn 0.3s ease;
}

.zam-modal-close {
    color: #9ca3af;
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.zam-modal-close:hover,
.zam-modal-close:focus {
    color: #374151;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-30px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- 8.2 - Modal Content (Budget, Ad Code) --- */
.zam-budget-estimator {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.zam-budget-estimator h4 {
    margin-top: 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.zam-budget-estimator p {
    margin: 10px 0;
    font-size: 15px;
    color: #374151;
}

.zam-budget-estimator span {
    font-weight: 700;
    color: #ef0606;
    font-size: 16px;
}

.zam-budget-estimator small {
    color: #6b7280;
    font-size: 13px;
    margin-left: 10px;
}

.zam-code-box {
    margin-bottom: 28px;
}

.zam-code-box h4 {
    margin-bottom: 10px;
    color: #1f2937;
    font-size: 15px;
    font-weight: 600;
}

.zam-code-box textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: #f9fafb;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
}

.zam-code-box .zam-copy-btn {
    margin-top: 12px;
}

#zam-ad-code-modal .zam-modal-content {
    max-width: 900px;
}

.zam-ad-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.zam-ad-template-option {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.zam-ad-template-option:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.zam-ad-template-option h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 15px;
    text-align: center;
    color: #1f2937;
    font-weight: 600;
}

#zam-ad-code-modal textarea {
    min-height: 90px;
    resize: vertical;
}

.zam-ad-template-preview {
    background-color: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    height: 300px;
}

.zam-ad-template-preview .zam-ad-preview-template {
    box-shadow: none;
    border: 1px solid #e5e7eb;
    margin: 0;
}

.zam-preview-spotlight-modal {
    transform: scale(0.7);
    transform-origin: center;
}

.zam-preview-story-modal {
    transform: scale(0.55);
    transform-origin: center;
}

.zam-preview-banner-modal {
    transform: scale(0.84);
    transform-origin: center;
}


/* --- 9.0 - Components --- */
/* --- 9.1 - Notifications --- */
.zam-notice {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 8px;
    border-left-width: 4px;
    border-left-style: solid;
    font-size: 14px;
}

.zam-notice-success {
    background-color: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.zam-notice-error {
    background-color: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

/* --- 9.2 - Action Menu Dropdown --- */
.zam-actions-menu {
    position: relative;
    display: inline-block;
}

.zam-actions-trigger {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #6b7280;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.zam-actions-trigger:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.zam-actions-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 100;
    min-width: 160px;
    padding: 6px 0;
}

.zam-actions-dropdown.zam-is-open {
    display: block;
}

.zam-actions-dropdown button,
.zam-actions-dropdown a {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    background: none;
    border: none;
    color: #374151;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.zam-actions-dropdown button:hover,
.zam-actions-dropdown a:hover {
    background-color: #f9fafb;
    color: #1f2937;
}

.zam-actions-dropdown .zam-pause-form {
    margin: 0;
}

/* --- 9.3 - Sponsored Tooltip --- */
.zam-sponsored-wrapper {
    position: absolute;
    top: -2px;
    right: 2px;
    z-index: 10;
}

.zam-sponsored-wrapper .zam-sponsored-tag,
.zeal-ad-unit .zam-sponsored-wrapper .zam-sponsored-tag {
    position: static;
    cursor: pointer;
}

.zam-sponsored-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    margin-top: 0;
    right: 0;
    width: 200px;
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25);
    font-size: 11px;
    line-height: 1.5;
    z-index: 9;
}

.zam-sponsored-tooltip.zam-is-visible {
    display: block;
}

.zam-sponsored-tooltip p {
    margin: 0;
    padding: 0;
}

.zam-sponsored-tooltip a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
}

.zam-sponsored-tooltip a:hover {
    text-decoration: underline;
}

/* --- 9.4 - Login Form Wrapper --- */
.zam-login-form-wrapper {
    max-width: 420px;
    margin: 40px auto;
    padding: 32px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.zam-login-form-wrapper form {
    margin: 0;
}

.zam-login-form-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
}

.zam-login-form-wrapper .input,
.zam-login-form-wrapper input[type="text"],
.zam-login-form-wrapper input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 15px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.zam-login-form-wrapper input[type="text"]:focus,
.zam-login-form-wrapper input[type="password"]:focus {
    outline: none;
    border-color: #ef0606;
    box-shadow: 0 0 0 3px rgba(239, 6, 6, 0.1);
}

.zam-login-form-wrapper .login-remember label {
    font-weight: normal;
    display: inline-flex;
    align-items: center;
}

.zam-login-form-wrapper .login-remember input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
}

.zam-login-form-wrapper .login-submit .button {
    background-color: #ef0606;
    color: #fff;
    border: none;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    text-shadow: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.zam-login-form-wrapper .login-submit .button:hover {
    background-color: #d10505;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 6, 6, 0.25);
}

.zam-login-form-wrapper #nav,
.zam-login-form-wrapper .login-lost-password,
.zam-login-form-wrapper .zam-register-link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

/* --- 9.5 - Registration Form --- */
.zam-register-form-wrapper {
    max-width: 480px;
    margin: 40px auto;
    padding: 32px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.zam-register-form-wrapper .zam-notice-error {
    margin-bottom: 24px;
    padding: 16px 20px;
}

.zam-register-form-wrapper .zam-form-row {
    margin-bottom: 20px;
}

.zam-register-form-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
}

.zam-register-form-wrapper input[type="text"],
.zam-register-form-wrapper input[type="email"],
.zam-register-form-wrapper input[type="password"],
.zam-register-form-wrapper select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 15px;
    transition: all 0.2s ease;
}

.zam-register-form-wrapper input[type="text"]:focus,
.zam-register-form-wrapper input[type="email"]:focus,
.zam-register-form-wrapper input[type="password"]:focus,
.zam-register-form-wrapper select:focus {
    outline: none;
    border-color: #ef0606;
    box-shadow: 0 0 0 3px rgba(239, 6, 6, 0.1);
}

.zam-register-form-wrapper .zam-terms-row label {
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    line-height: 1.5;
}

.zam-register-form-wrapper .zam-terms-row input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    flex-shrink: 0;
}

.zam-register-form-wrapper .zam-terms-row a {
    text-decoration: underline;
    color: #ef0606;
}

.zam-register-form-wrapper .zam-terms-row a:hover {
    color: #d10505;
}

.zam-register-form-wrapper .zam-button {
    width: 100%;
    margin-top: 12px;
}

.zam-register-form-wrapper .login-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

/* --- 9.6 - Utility Classes --- */
.zam-hidden {
    display: none;
}

/* --- 9.7 - Publisher Earnings Components --- */
.zam-balance-card,
.zam-withdrawal-card,
.zam-payment-form-card,
.zam-saved-method-box {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 28px;
    position: relative;
}
.zam-balance-card h3,
.zam-withdrawal-card h3,
.zam-payment-form-card h4,
.zam-saved-method-box h4 {
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}
.zam-balance-card .balance-amount {
    font-size: 32px;
    font-weight: 700;
    color: #ef0606;
    margin: 0;
}
.zam-saved-method-box p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #374151;
}
.zam-saved-method-box p strong {
    color: #1f2937;
}
.zam-saved-method-box pre {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 12px;
    border-radius: 6px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    margin-top: 0;
    color: #374151;
}
.zam-delete-method-form {
    position: absolute;
    top: 24px;
    right: 24px;
}
.zam-button-delete {
    background-color: #ef4444;
    color: #fff;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}
.zam-button-delete:hover {
    background-color: #dc2626;
    color: #fff;
    transform: translateY(-1px);
}

/* --- 9.8 - AI Keyword Generator --- */
.zam-keyword-tags-container {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 12px;
    border-radius: 8px;
    min-height: 48px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.zam-keyword-tag {
    display: inline-flex;
    align-items: center;
    background-color: #ef0606;
    color: #fff;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
}
.zam-remove-keyword {
    background: none;
    border: none;
    color: #fff;
    opacity: 0.8;
    cursor: pointer;
    margin-left: 8px;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: opacity 0.2s ease;
}
.zam-remove-keyword:hover {
    opacity: 1;
}
#zam-generate-keywords-btn .dashicons,
#zam-generate-keywords-btn-animated .dashicons {
    vertical-align: middle;
    margin-top: -2px;
    margin-right: 6px;
}
.zam-spin {
    animation: zam-spin-kf 1s infinite linear;
}
@keyframes zam-spin-kf {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- 9.9 - AI Content Refinement --- */
.zam-input-wrapper {
    position: relative;
    max-width: 450px;
}
.zam-input-wrapper input,
.zam-input-wrapper textarea {
    padding-right: 48px !important;
    max-width: 100%;
}
.zam-refine-content-btn {
    position: absolute;
    top: 1px;
    right: 1px;
    height: calc(100% - 2px);
    width: 46px;
    background: #f9fafb;
    border: none;
    border-left: 1px solid #e5e7eb;
    cursor: pointer;
    color: #ef0606;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.zam-refine-content-btn:hover {
    background: #f3f4f6;
    color: #d10505;
}
.zam-refine-content-btn .dashicons {
    font-size: 20px;
}
.zam-ai-suggestion-box {
    display: none;
    margin-top: 12px;
    padding: 16px;
    background-color: #eff6ff;
    border-left: 4px solid #ef0606;
    border-radius: 8px;
    max-width: 450px;
}
.zam-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.zam-suggestion-text {
    margin: 0;
    flex-grow: 1;
    font-style: italic;
    color: #1f2937;
    font-size: 14px;
}
.zam-accept-suggestion-btn {
    background-color: #10b981;
    color: #fff;
    border: none;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
    transition: all 0.2s ease;
}
.zam-accept-suggestion-btn:hover {
    background-color: #059669;
    transform: translateY(-1px);
}
.zam-suggestion-error {
    margin: 0;
    color: #dc2626;
    font-weight: 500;
    font-size: 14px;
}
.zam-fetch-status {
    font-size: 13px;
    margin-top: 12px;
    font-weight: 500;
}

/* --- 9.10 - App Creative Selector --- */
.zam-screenshot-choices-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.zam-screenshot-choice {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border: 3px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.zam-screenshot-choice:hover {
    border-color: #d1d5db;
    transform: scale(1.02);
}
.zam-screenshot-choice.selected {
    border-color: #ef0606;
    box-shadow: 0 0 0 2px rgba(239, 6, 6, 0.2);
}

.zam-reports-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 24px;
}

.zam-reports-filters label {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-right: 8px;
}

.zam-reports-filters input[type="date"] {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.zam-reports-filters input[type="date"]:focus {
    outline: none;
    border-color: #ef0606;
    box-shadow: 0 0 0 3px rgba(239, 6, 6, 0.1);
}

.zam-reports-filters .zam-button {
    padding: 10px 24px;
    margin-left: auto;
}

/* --- 10.0 - Responsive Design --- */
/* --- 10.1 - Tablet & Small Desktop --- */
@media screen and (max-width: 960px) {
    .zam-create-ad-layout {
        grid-template-columns: 1fr;
    }
    .zam-ad-preview-area {
        position: static;
        margin-top: 32px;
    }
    .zam-reports-filters {
        flex-wrap: wrap;
    }
    .zam-reports-filters .zam-button {
        margin-left: 0;
        width: 100%;
    }
}

/* --- 10.2 - Mobile Devices --- */
@media screen and (max-width: 782px) {
    .zam-dashboard-wrapper {
        grid-template-columns: 1fr;
        padding-bottom: 80px;
        gap: 20px;
    }
    .zam-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 24px;
    }
    .zam-card {
        padding: 20px;
    }
    .zam-card h2 {
        font-size: 20px;
    }
    .zam-card h3 {
        font-size: 17px;
    }
    .zam-form input[type="text"],
    .zam-form input[type="url"],
    .zam-form input[type="number"],
    .zam-form input[type="file"],
    .zam-form input[type="date"],
    .zam-form select,
    .zam-form textarea {
        max-width: 100%;
    }
    .zam-table {
        border: none;
        display: block;
    }
    .zam-table thead {
        display: none;
    }
    .zam-table tr {
        min-width: 345px;
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 16px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
@media (min-width: 600px) and (max-width: 1024px) {
    .zam-table tr {
        min-width: 720px;
    }
}

    .zam-table td {
        border-right: none;
        display: block;
        text-align: right;
        font-size: 15px;
        padding: 10px 0;
        border-bottom: 1px dashed #f3f4f6;
    }
    .zam-table td:last-child {
        border-bottom: none;
    }
    .zam-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: #1f2937;
        text-transform: uppercase;
        font-size: 12px;
        letter-spacing: 0.025em;
    }
    #tab-campaigns .zam-table td:nth-of-type(1)::before { content: 'Campaign'; }
    #tab-campaigns .zam-table td:nth-of-type(2)::before { content: 'Ad Type'; }
    #tab-campaigns .zam-table td:nth-of-type(3)::before { content: 'Status'; }
    #tab-campaigns .zam-table td:nth-of-type(4)::before { content: 'Budget'; }
    #tab-campaigns .zam-table td:nth-of-type(5)::before { content: 'Actions'; }
    #tab-my-sites .zam-table td:nth-of-type(1)::before { content: 'Site URL'; }
    #tab-my-sites .zam-table td:nth-of-type(2)::before { content: 'Status'; }
    #tab-my-sites .zam-table td:nth-of-type(3)::before { content: 'Actions'; }
    #tab-stats .zam-table td:nth-of-type(1)::before { content: 'Campaign/Site'; }
    #tab-stats .zam-table td:nth-of-type(2)::before { content: 'Impressions'; }
    #tab-stats .zam-table td:nth-of-type(3)::before { content: 'Clicks'; }
    #tab-stats .zam-table td:nth-of-type(4)::before { content: 'CTR'; }
    #tab-stats .zam-table td:nth-of-type(5)::before { content: 'Cost'; }
    #tab-billing .zam-table td:nth-of-type(1)::before { content: 'Order ID'; }
    #tab-billing .zam-table td:nth-of-type(2)::before { content: 'Date'; }
    #tab-billing .zam-table td:nth-of-type(3)::before { content: 'Amount'; }
    #tab-billing .zam-table td:nth-of-type(4)::before { content: 'Campaign'; }
    #tab-billing .zam-table td:nth-of-type(5)::before { content: 'Status'; }
    #tab-earnings .zam-table td:nth-of-type(1)::before { content: 'Date'; }
    #tab-earnings .zam-table td:nth-of-type(2)::before { content: 'Amount'; }
    #tab-earnings .zam-table td:nth-of-type(3)::before { content: 'Status'; }
    #tab-earnings .zam-table td:nth-of-type(4)::before { content: 'Details'; }
    #tab-campaigns .zam-table td:nth-of-type(5),
    #tab-my-sites .zam-table td:nth-of-type(3) {
        text-align: center;
    }
    .zam-reports-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .zam-reports-filters label {
        margin-bottom: 4px;
    }
    .zam-screenshot-choices-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}