/* CommerIQ Settings Page - Premium Modern Design */

/* ========================================
   Global Styles & Layout
   ======================================== */

body.woocommerce_page_commeriq-settings {
    background: #f6f7f9;
}

.commeriq-admin-wrap {
    background: #f6f7f9;
    margin: 0 -20px;
    padding: 0;
    min-height: 100vh;
}

/* ========================================
   Header Section
   ======================================== */

.commeriq-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 32px 40px;
    margin-bottom: 0;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.commeriq-header-content {
    max-width: 1400px;
    margin: 0 auto;
}

.commeriq-header-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.commeriq-logo-icon {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.commeriq-header h1 {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.commeriq-header .description {
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    margin: 0;
}

/* ========================================
   Tab Navigation
   ======================================== */

.nav-tab-wrapper {
    background: #fff;
    border-bottom: 2px solid #e1e4e8;
    margin: 0;
    padding: 0 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #57606a;
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 0 8px 0 0;
}

.nav-tab:hover {
    color: #667eea;
    border-bottom-color: #667eea;
    background: transparent;
}

.nav-tab-active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: transparent;
}

.nav-tab-disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* ========================================
   Tab Content
   ======================================== */

.commeriq-tab-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 40px 40px !important;
}

.commeriq-tab {
    display: none;
}

.commeriq-tab-active {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* ========================================
   License Card
   ======================================== */

.commeriq-license-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.commeriq-license-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.commeriq-license-card-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e1e4e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.commeriq-license-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.commeriq-status-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.commeriq-status-active {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.commeriq-status-inactive {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.commeriq-status-warning {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.commeriq-status-icon .dashicons {
    color: #fff;
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.commeriq-status-text h3 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.commeriq-status-text p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.commeriq-license-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.commeriq-license-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    height: auto;
    line-height: 1.5;
}

.commeriq-license-actions .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ========================================
   License Details
   ======================================== */

.commeriq-license-details {
    padding: 24px 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.commeriq-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.commeriq-detail-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.commeriq-detail-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.commeriq-detail-content {
    flex: 1;
    min-width: 0;
}

.commeriq-detail-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.commeriq-detail-value {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    word-break: break-all;
}

/* ========================================
   Features Showcase
   ======================================== */

.commeriq-features-showcase {
    padding: 24px 32px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-top: 1px solid #e1e4e8;
}

.commeriq-features-showcase h4 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.commeriq-features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.commeriq-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    transition: all 0.3s ease;
}

.commeriq-feature-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.commeriq-feature-icon {
    font-size: 20px;
    line-height: 1;
}

/* ========================================
   License Form
   ======================================== */

.commeriq-license-form {
    padding: 24px 32px;
}

.commeriq-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.commeriq-form-field {
    display: flex;
    flex-direction: column;
}

.commeriq-form-field label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.commeriq-form-field input[type="text"] {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
}

.commeriq-form-field input[type="text"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.commeriq-field-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.commeriq-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.commeriq-form-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    height: auto;
    line-height: 1.5;
    font-weight: 600;
}

.commeriq-form-actions .button-hero {
    font-size: 16px;
    padding: 14px 32px;
}

.commeriq-form-actions .button-large {
    font-size: 15px;
    padding: 12px 28px;
}

.commeriq-form-actions .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ========================================
   Features Preview
   ======================================== */

.commeriq-features-preview {
    padding: 32px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-top: 1px solid #e1e4e8;
}

.commeriq-features-preview h4 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
}

.commeriq-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.commeriq-feature-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.commeriq-feature-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
}

.commeriq-feature-card .commeriq-feature-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.commeriq-feature-card h5 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.commeriq-feature-card p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

/* ========================================
   Store Analyzer
   ======================================== */

.commeriq-page-header {
    background: #fff;
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #667eea;
}

.commeriq-page-header-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.commeriq-page-header-title::before {
    content: "📊";
    font-size: 32px;
}

.commeriq-page-header p {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.6;
}

.commeriq-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.commeriq-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.commeriq-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.commeriq-stat-icon {
    font-size: 40px;
    line-height: 1;
    flex-shrink: 0;
}

.commeriq-stat-content {
    flex: 1;
}

.commeriq-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 6px;
}

.commeriq-stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.commeriq-info-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.commeriq-info-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.commeriq-info-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.commeriq-info-header {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 16px 24px;
    border-bottom: 2px solid #e1e4e8;
    display: flex;
    align-items: center;
    gap: 12px;
}

.commeriq-info-header .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #667eea;
}

.commeriq-info-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.commeriq-info-body {
    padding: 20px 24px;
}

.commeriq-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.commeriq-info-row:last-child {
    border-bottom: none;
}

.commeriq-info-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 13px;
}

.commeriq-info-value {
    font-weight: 700;
    color: #1f2937;
    font-size: 14px;
    text-align: right;
}

/* ========================================
   Badges
   ======================================== */

.commeriq-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.commeriq-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.commeriq-badge-default {
    background: #f3f4f6;
    color: #6b7280;
}

/* ========================================
   Modal
   ======================================== */

.commeriq-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.commeriq-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.commeriq-modal-dialog {
    position: relative;
    z-index: 1;
    max-width: 500px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

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

.commeriq-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.commeriq-modal-icon {
    font-size: 64px;
    margin-bottom: 16px;
    line-height: 1;
}

.commeriq-modal-content h3 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.commeriq-modal-content p {
    margin: 0 0 24px;
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
}

.commeriq-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.commeriq-modal-actions .button {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
}

#commeriq-modal-confirm.button-primary {
    background: #dc2626;
    border-color: #dc2626;
}

#commeriq-modal-confirm.button-primary:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* ========================================
   Utilities
   ======================================== */

.button-link-delete {
    color: #dc2626 !important;
    border-color: #dc2626 !important;
}

.button-link-delete:hover {
    background: #dc2626 !important;
    color: #fff !important;
}

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1200px) {
    .commeriq-header {
        padding: 24px 32px;
    }

    .commeriq-tab-content {
        padding: 0 32px 32px;
    }

    .nav-tab-wrapper {
        padding: 0 32px;
    }
}

@media (max-width: 782px) {
    .commeriq-header {
        padding: 20px 24px;
    }

    .commeriq-header h1 {
        font-size: 24px;
    }

    .commeriq-tab-content {
        padding: 0 24px 24px;
    }

    .nav-tab-wrapper {
        padding: 0 24px;
    }

    .commeriq-license-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .commeriq-license-details {
        grid-template-columns: 1fr;
    }

    .commeriq-form-grid {
        grid-template-columns: 1fr;
    }

    .commeriq-features-grid {
        grid-template-columns: 1fr;
    }

    .commeriq-stats-grid {
        grid-template-columns: 1fr;
    }

    .commeriq-info-sections {
        grid-template-columns: 1fr;
    }

    .commeriq-features-list {
        grid-template-columns: 1fr;
    }
}