/**
 * AboveWP Admin Page Styles
 * Premium dark theme matching AboveWP platform
 */

/* Reset WordPress admin styles for our page */
body.wp-admin.abovewp_page_abovewp-tweaks-optimizer #wpcontent {
    padding-left: 0;
}

body.wp-admin.abovewp_page_abovewp-tweaks-optimizer #wpbody-content {
    padding-bottom: 0;
}

body.wp-admin.abovewp_page_abovewp-tweaks-optimizer .update-nag,
body.wp-admin.abovewp_page_abovewp-tweaks-optimizer .notice:not(.abovewp-notice) {
    display: none !important;
}

/* Full-page dark wrapper */
.abovewp-wrap {
    margin: -10px -20px 0 -20px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0a0a0f 0%, #111118 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

/* Background effects */
.abovewp-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.abovewp-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

.abovewp-bg-orb-1 {
    width: 600px;
    height: 600px;
    background: rgba(5, 130, 255, 0.08);
    top: -200px;
    left: -100px;
}

.abovewp-bg-orb-2 {
    width: 500px;
    height: 500px;
    background: rgba(168, 85, 247, 0.06);
    bottom: -150px;
    right: -100px;
}

/* Main content container */
.abovewp-container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 30px 60px;
}

/* Header */
.abovewp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.abovewp-logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.abovewp-logo {
    height: 36px;
    width: auto;
}

.abovewp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(5, 130, 255, 0.15), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(5, 130, 255, 0.3);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: #0582FF;
}

.abovewp-badge-dot {
    width: 6px;
    height: 6px;
    background: #0582FF;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.abovewp-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Section Cards */
.abovewp-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
}

.abovewp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.abovewp-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Typography */
.abovewp-wrap h1 {
    color: #ffffff;
    margin-bottom: 12px;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
}

.abovewp-wrap h2 {
    color: #ffffff;
    margin-bottom: 12px;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 600;
}

.abovewp-wrap h3 {
    color: #ffffff;
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;
}

.abovewp-wrap h4 {
    color: #e2e8f0;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
}

.abovewp-wrap p {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.abovewp-wrap a {
    color: #0582FF;
    text-decoration: none;
}

.abovewp-wrap a:hover {
    text-decoration: underline;
}

/* Buttons - AboveWP custom */
.abovewp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.abovewp-btn-primary {
    background: #0582FF;
    color: white;
    box-shadow: 0 4px 20px rgba(5, 130, 255, 0.3);
}

.abovewp-btn-primary:hover {
    background: #0470d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(5, 130, 255, 0.4);
    color: white;
}

.abovewp-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.abovewp-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* WordPress button overrides */
.abovewp-wrap .button,
.abovewp-wrap .button-primary {
    background: #0582FF;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-shadow: none;
    box-shadow: 0 4px 20px rgba(5, 130, 255, 0.3);
    height: auto;
    line-height: 1.5;
}

.abovewp-wrap .button:hover,
.abovewp-wrap .button-primary:hover {
    background: #0470d8;
    color: #ffffff;
    box-shadow: 0 6px 30px rgba(5, 130, 255, 0.4);
    transform: translateY(-1px);
}

.abovewp-wrap .button:focus,
.abovewp-wrap .button-primary:focus {
    box-shadow: 0 0 0 3px rgba(5, 130, 255, 0.3);
    outline: none;
    color: #ffffff;
}

.abovewp-wrap .button-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: none;
}

.abovewp-wrap .button-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Form Table */
.abovewp-wrap .form-table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 0;
}

.abovewp-wrap .form-table th {
    text-align: left;
    padding: 16px 12px;
    vertical-align: top;
    width: 220px;
    color: #e2e8f0;
    font-weight: 500;
    font-size: 14px;
}

.abovewp-wrap .form-table td {
    padding: 16px 12px;
}

.abovewp-wrap .form-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.abovewp-wrap .form-table tr:last-child {
    border-bottom: none;
}

/* Inputs */
.abovewp-wrap input[type="text"],
.abovewp-wrap input[type="password"],
.abovewp-wrap input[type="email"],
.abovewp-wrap input[type="number"],
.abovewp-wrap input[type="url"],
.abovewp-wrap input[type="tel"],
.abovewp-wrap input[type="search"],
.abovewp-wrap input[type="date"],
.abovewp-wrap input[type="time"],
.abovewp-wrap input[type="datetime-local"],
.abovewp-wrap input[type="month"],
.abovewp-wrap input[type="week"],
.abovewp-wrap textarea,
.abovewp-wrap select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    max-width: 500px;
    transition: all 0.2s ease;
}

.abovewp-wrap input[type="text"]::placeholder,
.abovewp-wrap input[type="password"]::placeholder,
.abovewp-wrap input[type="email"]::placeholder,
.abovewp-wrap input[type="number"]::placeholder,
.abovewp-wrap input[type="url"]::placeholder,
.abovewp-wrap textarea::placeholder {
    color: #64748b;
}

.abovewp-wrap input[type="text"]:focus,
.abovewp-wrap input[type="password"]:focus,
.abovewp-wrap input[type="email"]:focus,
.abovewp-wrap input[type="number"]:focus,
.abovewp-wrap input[type="url"]:focus,
.abovewp-wrap input[type="tel"]:focus,
.abovewp-wrap input[type="search"]:focus,
.abovewp-wrap input[type="date"]:focus,
.abovewp-wrap input[type="time"]:focus,
.abovewp-wrap input[type="datetime-local"]:focus,
.abovewp-wrap input[type="month"]:focus,
.abovewp-wrap input[type="week"]:focus,
.abovewp-wrap textarea:focus,
.abovewp-wrap select:focus {
    outline: none;
    border-color: #0582FF;
    box-shadow: 0 0 0 3px rgba(5, 130, 255, 0.15);
}

.abovewp-wrap input[type="color"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    width: 50px;
    height: 40px;
    cursor: pointer;
}

/* Checkboxes and Radio Buttons */
.abovewp-wrap input[type="checkbox"],
.abovewp-wrap input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    margin-right: 8px;
    transition: all 0.2s ease;
}

.abovewp-wrap input[type="radio"] {
    border-radius: 50%;
}

.abovewp-wrap input[type="checkbox"]:checked,
.abovewp-wrap input[type="radio"]:checked {
    background-color: #0582FF;
    border-color: #0582FF;
}

.abovewp-wrap input[type="checkbox"]:checked::before,
.abovewp-wrap input[type="radio"]:checked::before {
    margin: 0;
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.abovewp-wrap input[type="checkbox"]:checked::before {
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.abovewp-wrap input[type="radio"]:checked::before {
    width: 10px;
    height: 10px;
    background-color: #ffffff;
    border-radius: 50%;
}

.abovewp-wrap input[type="checkbox"]:hover,
.abovewp-wrap input[type="radio"]:hover {
    border-color: #0582FF;
    box-shadow: 0 0 0 2px rgba(5, 130, 255, 0.15);
}

.abovewp-wrap input[type="checkbox"]:focus,
.abovewp-wrap input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 130, 255, 0.2);
}

/* Labels */
.abovewp-wrap label {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* Description text */
.abovewp-wrap .description,
.abovewp-wrap p.description {
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
    line-height: 1.5;
    font-style: normal;
}

/* WordPress Color Picker Customization */
.abovewp-wrap .wp-picker-container {
    display: inline-block;
    position: relative;
}

.abovewp-wrap .wp-picker-container .wp-color-result {
    height: 36px;
    border-radius: 8px;
    box-shadow: none;
    padding-left: 44px;
    background-image: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.abovewp-wrap .wp-picker-container .wp-color-result:after {
    background-color: rgba(0, 0, 0, 0.3);
    color: #e2e8f0;
    border-radius: 0 8px 8px 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 34px;
}

.abovewp-wrap .wp-picker-container .wp-color-result:hover:after {
    color: #0582FF;
}

.abovewp-wrap .wp-picker-container .wp-picker-input-wrap {
    margin-top: 8px;
}

.abovewp-wrap .wp-picker-container .wp-picker-input-wrap label {
    display: inline-block;
    margin-right: 5px;
}

.abovewp-wrap .wp-picker-container .wp-picker-input-wrap .wp-color-picker {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    height: 36px;
    padding: 0 10px;
    width: 90px;
}

.abovewp-wrap .wp-picker-container .iris-picker {
    background-color: #111118 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.abovewp-wrap .wp-picker-container .iris-picker .iris-square,
.abovewp-wrap .wp-picker-container .iris-picker .iris-strip {
    border-radius: 6px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.abovewp-wrap .wp-picker-container .iris-picker .iris-palette {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
    border-radius: 4px;
}

.abovewp-wrap .wp-picker-container .iris-picker .iris-palette-container {
    padding: 6px 0 0 0;
}

.abovewp-wrap .wp-picker-container .iris-picker .iris-palette:hover {
    box-shadow: 0 0 0 2px #0582FF !important;
}

.abovewp-wrap .wp-color-result-text {
    background: rgba(0, 0, 0, 0.3);
    color: #e2e8f0;
    border-left: 1px solid transparent;
}

/* Notices */
.abovewp-wrap .notice,
.abovewp-notice {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    background: rgba(5, 130, 255, 0.08);
    border: 1px solid rgba(5, 130, 255, 0.15);
    border-left: 4px solid #0582FF;
    color: #e2e8f0;
}

.abovewp-wrap .notice p {
    color: #e2e8f0;
    margin: 0;
}

.abovewp-wrap .notice.notice-warning {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.15);
    border-left-color: #fbbf24;
}

.abovewp-wrap .notice.notice-error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
    border-left-color: #ef4444;
}

.abovewp-wrap .notice.notice-success {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.15);
    border-left-color: #22c55e;
}

/* Tables */
.abovewp-wrap table.widefat {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    border-spacing: 0;
    width: 100%;
    overflow: hidden;
}

.abovewp-wrap table.widefat th {
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    padding: 14px 16px;
    text-align: left;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.abovewp-wrap table.widefat td {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding: 14px 16px;
    color: #94a3b8;
}

.abovewp-wrap table.widefat tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Tabs */
.abovewp-admin-tabs {
    margin: 20px 0;
}

.abovewp-admin-tabs-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.abovewp-admin-tabs-list li {
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    margin-right: 5px;
    padding: 10px 20px;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.abovewp-admin-tabs-list li:hover {
    color: #ffffff;
}

.abovewp-admin-tabs-list li.tab-active {
    color: #0582FF;
    border-bottom-color: #0582FF;
}

.abovewp-admin-tab-content {
    display: none;
    padding: 20px 0;
}

.abovewp-admin-tab-content.tab-active {
    display: block;
}

/* Custom Styles for Specific Elements */
.abovewp-add-discount-form {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    margin-bottom: 20px;
    padding: 20px;
}

.abovewp-discount-rules-list {
    margin-top: 30px;
}

.abovewp-wrap .spinner.is-active {
    visibility: visible;
    float: none;
    margin: 0 10px 0 0;
    vertical-align: middle;
    opacity: 0.7;
}

.abovewp-discount-rules-list .widefat td,
.abovewp-discount-rules-list .widefat th {
    color: #e2e8f0;
}

/* Footer */
.abovewp-footer {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 40px;
}

.abovewp-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.abovewp-footer-links a {
    font-size: 13px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.abovewp-footer-links a:hover {
    color: #0582FF;
}

.abovewp-footer-copy {
    font-size: 12px;
    color: #475569;
}

/* Submit button area */
.abovewp-wrap .submit {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Loading animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 782px) {
    .abovewp-container {
        padding: 20px 15px 40px;
    }

    .abovewp-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        margin-bottom: 30px;
        padding-bottom: 20px;
    }

    .abovewp-section {
        padding: 20px;
        border-radius: 16px;
    }

    .abovewp-wrap .form-table th {
        width: auto;
        display: block;
        padding: 12px 0 4px 0;
    }

    .abovewp-wrap .form-table td {
        display: block;
        padding: 4px 0 16px 0;
    }

    .abovewp-wrap input[type="text"],
    .abovewp-wrap input[type="number"],
    .abovewp-wrap input[type="url"],
    .abovewp-wrap textarea,
    .abovewp-wrap select {
        max-width: 100%;
    }

    .abovewp-footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

/* AI Agent Promo Banner */
.abovewp-ai-banner {
    background: linear-gradient(135deg, rgba(5, 130, 255, 0.15) 0%, rgba(168, 85, 247, 0.15) 50%, rgba(236, 72, 153, 0.1) 100%);
    border: 1px solid rgba(5, 130, 255, 0.3);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.abovewp-ai-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(5, 130, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.abovewp-ai-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.abovewp-ai-banner-text h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
}

.abovewp-ai-banner-text p {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0 0 16px 0;
    max-width: 600px;
}

.abovewp-ai-banner-perks {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.abovewp-ai-banner-perk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #0582FF;
    background: rgba(5, 130, 255, 0.1);
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid rgba(5, 130, 255, 0.2);
}

.abovewp-ai-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.abovewp-ai-banner-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.abovewp-wrap .abovewp-ai-banner-btn-primary,
.abovewp-ai-banner-btn-primary {
    background: #0582FF;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(5, 130, 255, 0.3);
}

.abovewp-wrap .abovewp-ai-banner-btn-primary:hover,
.abovewp-ai-banner-btn-primary:hover {
    background: #0470d8;
    color: #ffffff;
    box-shadow: 0 6px 30px rgba(5, 130, 255, 0.4);
    transform: translateY(-1px);
}

.abovewp-ai-banner-btn-secondary {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.abovewp-ai-banner-btn-secondary:hover {
    background: rgba(168, 85, 247, 0.25);
    color: #c084fc;
    transform: translateY(-1px);
}

@media screen and (max-width: 782px) {
    .abovewp-ai-banner-content {
        flex-direction: column;
        text-align: center;
    }

    .abovewp-ai-banner-perks {
        justify-content: center;
    }

    .abovewp-ai-banner-actions {
        width: 100%;
    }

    .abovewp-ai-banner-btn {
        width: 100%;
    }
}
