/* Master Addons Popup Builder Styles */

.ma-popup-builder {
    margin: 20px 20px 0 2px;
}

.ma-popup-builder-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.ma-popup-main-content {
    flex: 1;
    min-width: 0;
}

.ma-popup-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.ma-popup-sidebar .postbox {
    margin-bottom: 20px;
}

/* Status Indicators */
.ma-popup-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.ma-status-active {
    background: #d4edda;
    color: #155724;
}

.ma-status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.ma-popup-status:hover {
    opacity: 0.8;
}

/* Conversion Rate */
.conversion-rate {
    color: #666;
    font-size: 11px;
}

/* Form Styles */
.ma-popup-builder .form-table th {
    width: 200px;
}

.ma-popup-builder .form-table td {
    vertical-align: top;
}

.ma-popup-builder textarea.large-text {
    width: 100%;
    max-width: 600px;
}

/* Trigger Settings */
.trigger-scroll-row,
.trigger-element-row,
.specific-pages-row {
    transition: opacity 0.3s;
}

/* Templates Page */
.ma-popup-templates {
    max-width: 1400px;
}

.ma-template-categories {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ma-category-filter {
    padding: 8px 16px;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.ma-category-filter:hover {
    background: #e8e8e8;
}

.ma-category-filter.active {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

.ma-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.ma-template-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: transform 0.3s, box-shadow 0.3s;
}

.ma-template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ma-template-preview {
    height: 200px;
    background: #f5f5f5;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.ma-template-content {
    transform: scale(0.5);
    transform-origin: top left;
    width: 200%;
    pointer-events: none;
}

.ma-template-info {
    padding: 20px;
}

.ma-template-info h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.ma-template-info p {
    color: #666;
    margin: 0 0 15px;
    font-size: 14px;
}

.ma-template-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.ma-template-type,
.ma-template-category {
    display: inline-block;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 12px;
}

.ma-use-template {
    width: 100%;
}

/* Template Preview Styles */
.ma-popup-template-newsletter,
.ma-popup-template-discount,
.ma-popup-template-cookie,
.ma-popup-template-contact,
.ma-popup-template-announcement,
.ma-popup-template-exit,
.ma-popup-template-video,
.ma-popup-template-age,
.ma-popup-template-social,
.ma-popup-template-survey {
    text-align: center;
    padding: 20px;
}

.ma-popup-template-newsletter h2,
.ma-popup-template-discount h2,
.ma-popup-template-exit h2,
.ma-popup-template-age h2 {
    margin: 0 0 15px;
    font-size: 24px;
}

.ma-popup-template-newsletter input,
.ma-popup-template-contact input,
.ma-popup-template-contact textarea,
.ma-popup-template-exit input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ma-popup-template-newsletter button,
.ma-popup-template-contact button,
.ma-popup-template-exit button {
    padding: 12px 30px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.ma-discount-badge {
    display: inline-block;
    padding: 5px 15px;
    background: #ff4444;
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
}

.ma-cta-button {
    padding: 12px 30px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.ma-popup-template-cookie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #333;
    color: white;
}

.ma-popup-template-cookie p {
    margin: 0;
    flex: 1;
}

.ma-accept-cookies,
.ma-decline-cookies {
    padding: 8px 20px;
    margin-left: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.ma-accept-cookies {
    background: #28a745;
    color: white;
}

.ma-decline-cookies {
    background: transparent;
    color: white;
    border: 1px solid white;
}

/* Settings Page Tabs */
.ma-settings-tabs {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 20px;
}

.ma-tabs-nav {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid #ddd;
}

.ma-tabs-nav li {
    margin: 0;
}

.ma-tabs-nav a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    border-right: 1px solid #ddd;
    transition: background 0.3s;
}

.ma-tabs-nav a:hover {
    background: #f5f5f5;
}

.ma-tabs-nav li.active a {
    background: #f9f9f9;
    font-weight: 600;
    color: #2271b1;
}

.ma-tab-pane {
    display: none;
    padding: 30px;
}

.ma-tab-pane.active {
    display: block;
}

.ma-tab-pane h2 {
    margin-top: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ma-templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 782px) {
    .ma-popup-builder-container {
        flex-direction: column;
    }
    
    .ma-popup-sidebar {
        width: 100%;
    }
    
    .ma-templates-grid {
        grid-template-columns: 1fr;
    }
    
    .ma-tabs-nav {
        flex-direction: column;
    }
    
    .ma-tabs-nav a {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
}

/* Loading States */
.ma-loading {
    opacity: 0.6;
    pointer-events: none;
}

.ma-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: ma-spin 1s linear infinite;
}

@keyframes ma-spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.ma-notice {
    padding: 12px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 14px;
}

.ma-notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ma-notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}