/**
 * DiveWP - WordPress Plugin Global Styles
 *
 * This file contains the global styles for the DiveWP plugin.
 * It follows WordPress coding standards and guidelines.
 *
 * @package     DiveWP
 * @author      Oleg Petrov
 * @copyright   2023 DiveWP
 * @license     GPL-2.0-or-later
 *
 * @wordpress-plugin
 * CSS Name: DiveWP Global Styles
 * CSS URI: https://divewp.com/
 * Description: Global styles for the DiveWP plugin interface and components
 * Version: 1.0.4
 * Requires at least: 5.8
 * Tested up to: 6.4.2
 * Requires PHP: 7.4
 */

/* Literata Font */
@font-face {
    font-family: 'Literata';
    src: url('../fonts/literata-variable.ttf') format('truetype-variations'),
        url('../fonts/literata-variable.ttf') format('truetype');
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
    font-variation-settings: 'opsz' 7, 'wght' 400;
}

@font-face {
    font-family: 'Literata';
    src: url('../fonts/literata-variable-italic.ttf') format('truetype-variations'),
        url('../fonts/literata-variable-italic.ttf') format('truetype');
    font-weight: 200 900;
    font-style: italic;
    font-display: swap;
    font-variation-settings: 'opsz' 7, 'wght' 400;
}

/* ==========================================================================
   DiveWP Global Styles
   ========================================================================== */

/* Container Layout
   ========================================================================== */
.divewp-container {
    display: flex;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 20px;
    overflow: hidden;
}

/* Typography Hierarchy with Variable Font Settings
   ========================================================================== */
/* Base Typography */
.divewp-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* Heading Hierarchy */
.divewp-container h1,
.divewp-container h2,
.divewp-container h3,
.divewp-container h4,
.divewp-container h5,
.divewp-container h6,
.divewp-notice h1,
.divewp-notice h2,
.divewp-notice h3,
.divewp-notice h4,
.divewp-notice h5,
.divewp-notice h6,
.recommendation-title {
    font-family: 'Literata', serif;
}

.divewp-container h1,
.divewp-notice h1 {
    font-variation-settings: 'opsz' 24, 'wght' 700;
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: 1.2rem;
}

.divewp-container h2,
.divewp-notice h2 {
    font-variation-settings: 'opsz' 24, 'wght' 700;
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.divewp-container h3,
.divewp-notice h3 {
    font-variation-settings: 'opsz' 18, 'wght' 600;
    font-size: 1.3rem;
    line-height: 1.4;
    margin-bottom: 0.8rem;
}

.divewp-container h4,
.divewp-notice h4 {
    font-variation-settings: 'opsz' 18, 'wght' 600;
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 0.6rem;
}

.divewp-container h5,
.divewp-notice h5 {
    font-variation-settings: 'opsz' 18, 'wght' 500;
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.divewp-container h6,
.divewp-notice h6 {
    font-variation-settings: 'opsz' 18, 'wght' 500;
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* Card Components */
.recommendation-title {
    font-size: 1.1rem !important;
    margin: 0 0 12px 0;
    font-variation-settings: 'opsz' 18, 'wght' 600;
    line-height: 1.3;
}

.recommendation-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
}

/* Status Pills with Optimized Typography */
.status-pill {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-variation-settings: normal;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 500;
}

/* Responsive Typography
   ========================================================================== */
@media (max-width: 1200px) {

    .divewp-container h1,
    .divewp-notice h1 {
        font-size: 1.6rem;
        font-variation-settings: 'opsz' 24, 'wght' 700;
    }

    .divewp-container h2,
    .divewp-notice h2 {
        font-size: 1.4rem;
    }

    .divewp-container h3,
    .divewp-notice h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {

    .divewp-container h1,
    .divewp-notice h1 {
        font-size: 1.4rem;
        font-variation-settings: 'opsz' 18, 'wght' 700;
    }

    .divewp-container h2,
    .divewp-notice h2 {
        font-size: 1.3rem;
        font-variation-settings: 'opsz' 18, 'wght' 700;
    }

    .divewp-container h3,
    .divewp-notice h3 {
        font-size: 1.2rem;
        font-variation-settings: 'opsz' 18, 'wght' 600;
    }

    .recommendation-title {
        font-size: 1rem !important;
        font-variation-settings: 'opsz' 7, 'wght' 600;
    }
}

/* Notice Components
   ========================================================================== */
.divewp-notice {
    margin: 20px 0;
    padding: 16px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.divewp-notice-warning {
    background-color: #FFEFD9;
    color: #B95000;
}

.divewp-notice-info {
    background-color: #EFF8FF;
    color: #1A5598;
}

.divewp-notice-success {
    background-color: #DBFFE0;
    color: #0D894F;
}

.divewp-notice-error {
    background-color: #FFE1E1;
    color: #D92D20;
}

/* Status Pills
   ========================================================================== */
.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 10px;
    color: #ffffff;

}

.status-pill-success {
    background-color: #10b981; /* Excellent - Green (matches card ratings) */
}

.status-pill-warning {
    background-color: #f59e0b; /* Fair - Orange/Yellow (matches card ratings) */
}

.status-pill-danger {
    background-color: #ef4444; /* Poor/Critical - Red (matches card ratings) */
}

.status-pill-info {
    background-color: #3b82f6; /* Good - Blue (matches card ratings) */
}

/* New Feature Highlight Pill used on the left sidebar
   ========================================================================== */
.new-feature-coming-soon-pill {
    color: #ed8936;
    background: linear-gradient(135deg, #FDF2E9 0%, #FAE5D3 100%);
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-left: 10px;
}

.new-feature-highlight-pill {
    color: #ffffff;
    background-color: #4299e1;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-left: 10px;
    animation: pulseFade 2s ease-in-out infinite;
}

@keyframes pulseFade {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Icons and Bullets
   ========================================================================== */
.divewp-icon {
    width: 32px;
    height: 32px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #48bb78;
    border: 1px solid #e5e5e5;
}

/* Lists
   ========================================================================== */
.divewp-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}

.divewp-list li {
    margin-bottom: 8px;
    padding-left: 24px;
    position: relative;
}

.divewp-list li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: #48bb78;
}

/* Tables
   ========================================================================== */
.divewp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin: 24px 0;
    overflow: hidden;
}

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

.divewp-table th {
    background: #f8f9fa;
    color: #4a5568;
    font-weight: 600;
    font-size: 14px;
}

.divewp-table tr:last-child td {
    border-bottom: none;
}

.divewp-table tr:hover td {
    background-color: #f7fafc;
}

/* Buttons
   ========================================================================== */
.divewp-button {
    display: inline-block;
    padding: 8px 16px;
    background: #48bb78;
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none !important;
    font-size: 14px;
    transition: all 0.2s;
    border: none !important;
}

.divewp-button:hover {
    background: #38a169;
    color: #fff !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

/* Tooltips
   ========================================================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background-color: #333;
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 9999;
    pointer-events: none;
    margin-bottom: 5px;
}

[data-tooltip]:hover:before {
    visibility: visible;
    opacity: 1;
}

/* Recommendations Layout
   ========================================================================== */
.divewp-recommendations {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-top: 24px;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin: 40px 0 24px 0;
}

/* Recommendation Cards
   ========================================================================== */
.recommendation-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: transform 0.2s ease;
    border: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.recommendation-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Card Top Section */
.recommendation-top {
    flex-shrink: 0;
    margin-bottom: 16px;
}

/* Card Header */
.recommendation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.recommendation-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #48bb78;
}

.recommendation-title {
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

/* Card Middle Section */
.recommendation-middle {
    flex-grow: 1;
    overflow: hidden;
}

/* Card Content */
.recommendation-content {
    color: #4a5568;
}

.recommendation-content p {
    margin: 0 0 12px 0;
}

.recommendation-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recommendation-steps li {
    margin-bottom: 8px;
    padding-left: 24px;
    position: relative;
}

.recommendation-steps li:last-child {
    margin-bottom: 0;
}

.recommendation-steps li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: #48bb78;
}

/* Card Bottom Section */
.recommendation-bottom {
    flex-shrink: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 16px;
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* Expandable Content */
.recommendation-expand {
    font-size: 1rem;
    color: #4a5568;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.recommendation-expand svg {
    transition: transform 0.2s ease;
}

.recommendation-details {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.recommendation-details.active {
    display: block;
}

/* Warning Notice
   ========================================================================== */
.divewp-notice-warning {
    margin-top: 24px;
    padding: 16px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background-color: #FFEFD9;
    color: #B95000;
}

/* Navigation Menu
   ========================================================================== */
.divewp-tabs-column {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    height: 100%;
}

.divewp-logo-container {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.divewp-navigation {
    padding: 16px 0;
}

/* Navigation Sections */
.nav-section {
    margin-bottom: 24px;
}

.nav-section-header {
    padding: 0 24px 8px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

/* Navigation Items */
.divewp-tabs {
    list-style: none;
    margin: 0;
    padding: 0;
}

.divewp-tabs li {
    display: flex;
    align-items: center;
    padding: 8px 24px;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 1px 0;
    position: relative;
}

.divewp-tabs li:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.divewp-tabs li.active {
    color: #111827;
    background-color: #f3f4f6;
    font-weight: 500;
}

/* Icons */
.divewp-tabs li i {
    margin-right: 12px;
    color: #6b7280;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.divewp-tabs li:hover i,
.divewp-tabs li.active i {
    color: #48bb78;
}


/* Primary Navigation (Dashboard)
   ========================================================================== */
.divewp-nav-primary .divewp-tabs li {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.divewp-nav-primary .divewp-tabs li:hover {
    background-color: #f1f5f9;
}

.divewp-nav-primary .divewp-tabs li.active {
    background-color: #f1f5f9;
    border-left: 4px solid #48bb78;
}

/* Secondary Navigation
   ========================================================================== */
.divewp-nav-secondary {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.divewp-nav-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Navigation Headers */
.divewp-nav-heading {
    padding: 0 24px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
}

/* Navigation Items */
.divewp-nav-secondary .divewp-tabs li {
    padding: 12px 24px;
    font-size: 14px;
    color: #475569;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.divewp-nav-secondary .divewp-tabs li:hover {
    background-color: #f8fafc;
    color: #1e293b;
}

.divewp-nav-secondary .divewp-tabs li.active {
    background-color: #f8fafc;
    color: #1e293b;
    font-weight: 500;
    border-left-color: #48bb78;
}

/* Sidebar Sections
   ========================================================================== */
.sidebar-section {
    margin-bottom: 32px;
    padding: 0;
    background: #fff;
    border-radius: 8px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    margin-bottom: 12px;
    color: #1a1d1f;
    font-size: 14px;
}

/* oleg Sidebar Specific Styles 
.divewp-sidebar h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #1d2327;
    line-height: 1.3;
} */

/* AI Plan Section Styles
   ========================================================================== */
.ai-description {
    font-size: 14px;
    line-height: 1.5;
    color: #4a5568;
    margin-bottom: 16px;
}

.ai-features {
    list-style: none;
    padding-left: 24px;
    margin: 0 0 20px 0;
}

.ai-features li {
    position: relative;
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 8px;
    line-height: 1.4;
}

.ai-features li:before {
    content: "•";
    position: absolute;
    left: -16px;
    color: #48bb78;
    font-weight: bold;
}

.divewp-tabs li.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.divewp-tabs li.disabled:hover {
    background-color: transparent;
}

.request-feature-section {
    margin-top: auto;
    padding: 20px 0;
}

.request-feature-button {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #2271b1;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.request-feature-button:hover {
    background-color: rgba(34, 113, 177, 0.1);
    color: #2271b1;
}

.request-feature-button .dashicons {
    margin-right: 8px;
    font-size: 16px;
}

.feature-pill.info-pill {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    color: #1976D2;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
    font-weight: 500;
}

.contact-header {
    display: flex;
    align-items: center;
    padding: 0 15px 10px;
    color: #1d2327;
    font-weight: 500;
}

.contact-buttons {
    display: flex;
    gap: 8px;
    padding: 0 15px;
}

.contact-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-decoration: none;
    color: #2271b1;
    background: #f0f0f1;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.contact-button:hover {
    background: #e0e0e1;
    color: #2271b1;
}

.contact-button .dashicons {
    margin-right: 6px;
    font-size: 16px;
}

/* Hide preloader elements */
#divewp-preloader {
    display: none !important;
}

#divewp-preloader p,
#divewp-preloader .progress-bar,
#divewp-preloader .progress {
    display: none !important;
}

/* Disable preloader animations */
@keyframes progress {

    0%,
    100% {
        opacity: 0;
    }
}

@keyframes hidePreloader {

    0%,
    100% {
        opacity: 0;
    }
}

/* Loading Animation
========================================================================== */
.divewp-loader {
    width: 50px;
    aspect-ratio: 1;
    display: grid;
    border: 4px solid #0000;
    border-radius: 50%;
    border-right-color: #25b09b;
    animation: divewp-spin 1s infinite linear;
    margin: 20px auto;
}

.divewp-loader::before,
.divewp-loader::after {
    content: "";
    grid-area: 1/1;
    margin: 2px;
    border: inherit;
    border-radius: 50%;
    animation: divewp-spin 2s infinite;
}

.divewp-loader::after {
    margin: 8px;
    animation-duration: 3s;
}

/* Loading container styles */
.divewp-loading-container {
    text-align: center;
    padding: 20px;
    color: #666;
}

.divewp-loading-container p {
    margin: 10px 0 0;
    font-size: 14px;
}

@keyframes divewp-spin {
    100% {
        transform: rotate(1turn)
    }
}

/* Spinner utilities - used across all features */
.dashicons.spinning {
    animation: divewp-spin 1s linear infinite;
}

.divewp-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.divewp-button.loading .dashicons {
    animation: divewp-spin 1s linear infinite;
}

/* Hide default spinner when using custom loader */
.divewp-loading-container .dashicons.spinning {
    display: none;
}

/* ==========================================================================
   Component Breakdown Styles
   ========================================================================== */

.component-breakdown {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

.component-breakdown-title {
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 12px;
    font-size: 14px;
}

.component-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e1e1e1;
}

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

.component-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.component-label {
    font-weight: 500;
    color: #1d2327;
    font-size: 13px;
}

.component-value {
    color: #646970;
    font-size: 12px;
    font-weight: 400;
}

.component-analysis {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.component-points {
    font-weight: 600;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 3px;
    color: white;
}

.component-detail {
    color: #646970;
    font-size: 11px;
    max-width: 200px;
}

/* Component rating colors */
.component-excellent {
    background-color: #00a32a;
}

.component-good {
    background-color: #007cba;
}

.component-fair {
    background-color: #f59e0b;
}

.component-poor {
    background-color: #d63638;
}

.component-critical {
    background-color: #8a2432;
}

.component-unknown {
    background-color: #646970;
}

/* ==========================================================================
   Score Factors Explanation Styles
   ========================================================================== */

.score-factors-explanation {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007cba;
}

.factors-title {
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 6px;
    font-size: 13px;
}

.factors-text {
    color: #50575e;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 400;
}