/* Basic styling for the WPSummarize settings page */
.wpsummarize_settings_form h2 {
    color: #333;
    font-size: 20px;
}

.wpsummarize_settings_form input[type="checkbox"] {
    margin-right: 5px;
}

.wpsummarize_settings_form select {
    margin: 5px 0;
    width: 100%;
    max-width: 300px;
}

.wpsummarize_nav_tab_wrapper .wpsummarize_nav_tab {
    margin: 0 5px 0 0;
    padding: 6px 10px;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
}

.wpsummarize_nav_tab_wrapper .wpsummarize_nav_tab_active {
    background-color: #fff;
    border-bottom: 1px solid #fff;
}

.wpsummarize_settings_form .form-table td {
	line-height: 2;
}

.wpsummarize_settings_form .form-table th {
	width:25%;
}

.wpsummarize_settings_form form {
	background: white;
	margin-top: 20px;
	border: 1px solid #c3c4c7;
	box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.wpsummarize_settings_form p, .wpsummarize_settings_form table, .wpsummarize_settings_form h2 {
    padding-left: 20px;
}

.wpsummarize_settings_form input[type="range"] {
    width: 100%;
    max-width:300px;
}

.wpsummarize_settings_form .form-table {
    border-spacing: 0 20px;
      border-collapse: separate;
}

.wpsummarize_settings_form form img {
	width: 250px !important;
	height: auto;
	display: block;
}

.wpsummarize_settings_form .wrap_themes {
    display:flex;
    flex-wrap: wrap;
    gap: 20px;
}

.wpsummarize_settings_form .wrap_themes input {
     margin-left: 10px;
}

.wpsummarize_dashboard_tokens {
	width: 100%;
    font-size: 15px;
    font-weight:600;
	display: block;
	background: white;
	padding: 10px;
	box-sizing: border-box;
	border: 1px solid #c3c4c7;
	box-shadow: 0 1px 1px rgba(0,0,0,.04);
	margin-top: 30px;
}

.wpsummarize_settings_form h2.wpsummarize_settings_title.subtitle {
    font-size: 23px;
    font-weight: 400;
    padding:0;
    line-height: 1.3; 
    margin-top: 30px;
}

.wpsummarize_settings_form ul {
  list-style: disc;
  margin-top:0;
}

#wpsummarize_meta_box ul {
  list-style: disc;
  list-style-position: inside;
}

.item-wpsummarize-meta-box {
    display: block; line-height: 30px; min-height: 32px; padding: 10px 0;font-weight:600;
}

.wpsummarize-customization-control .customization-options {
    display: inline-block;
}

.wpsummarize-toggle-customization {
    display:inline-block;
    margin: 0 125px 0 120px;
    font-style: italic;
    vertical-align: top;
}

.wpsummarize-customization-control-flex {
    /*display: flex;
    justify-content: space-evenly;*/
}
.wpsummarize-customization-control label {
    display: inline-block;
	vertical-align: top;
    padding-bottom: 10px;
}

.wpsummarize-customization-control {
    border-top: 1px solid #c3c4c7;
      margin-bottom: 20px;
}

#wp-wpsummarize_summary_editor-editor-container {
	margin-bottom: 20px;
}

#wpsummarize_loadingIndicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 4px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #000;
    animation: wpsummarize_spin 1s ease-in-out infinite;
    margin:auto;
}

@keyframes wpsummarize_spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


@media(max-width:768px){
    .wpsummarize-toggle-customization {
    	display: block;
    	margin: 10px 0 20px 0;
    }
    
    .wpsummarize_settings_form .wrap_themes {
    display:block;
    }
    .wpsummarize_settings_form form img {
	width: 90% !important;
	margin-top: 10px;
    }
    .wpsummarize_settings_form .form-table th,.wpsummarize_settings_form .form-table td {
	width: 95%;
	margin-bottom: 10px;
    }
    .wrap.wpsummarize_settings_form input, .wrap.wpsummarize_settings_form select {
	max-width: 90% !important;
    }
    .wpsummarize_settings_form p, .wpsummarize_settings_form table, .wpsummarize_settings_form h2 {
	padding-left: 10px;
    }
}


/* =============================================================================
   WPSummarize Theme Selector + Customization + AI Match — Admin Styles
   Append to your existing admin-style.css
   ============================================================================= */


/* ---------------------------------------------
   THEME THUMBNAIL STRIP
   --------------------------------------------- */

.wpsummarize-theme-description {
    color: #646970;
    font-size: 13px;
    margin: 0 0 16px 0;
}

.wpsummarize-theme-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.wpsummarize-theme-strip--compact { margin-bottom: 0; }

.wpsummarize-theme-thumb {
    position: relative;
    width: 150px;
    border: 2px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.wpsummarize-theme-thumb:hover {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.wpsummarize-theme-thumb.active {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px #2271b1;
}

.wpsummarize-theme-thumb.active::after {
    content: '\2713';
    position: absolute;
    top: 5px; right: 5px;
    width: 20px; height: 20px;
    background: #2271b1; color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; line-height: 1;
    z-index: 2;
}

.wpsummarize-theme-thumb .wpsummarize-theme-radio {
    position: absolute; opacity: 0; pointer-events: none;
}

.wpsummarize-theme-thumb-image {
    display: block; height: 102px; overflow: hidden; background: #f6f7f7;
}

.wpsummarize-theme-thumb-image img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: top left;
    display: block;
}

.wpsummarize-theme-thumb-label {
    display: block; text-align: center;
    padding: 6px 4px 7px;
    font-size: 12px; font-weight: 500; color: #1d2327;
    border-top: 1px solid #dcdcde; background: #f6f7f7;
}


/* ---------------------------------------------
   PREVIEW PANEL
   --------------------------------------------- */

.wpsummarize-preview-panel {
    border: 1px solid #dcdcde; border-radius: 4px; overflow: hidden;
}

.wpsummarize-preview-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px; background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
    gap: 10px; flex-wrap: wrap;
}

.wpsummarize-preview-toolbar-left {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.wpsummarize-preview-label {
    font-size: 11px; font-weight: 600; color: #646970;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.wpsummarize-preview-post-select {
    font-size: 13px; padding: 4px 8px;
    border: 1px solid #8c8f94; border-radius: 4px;
    background: #fff; color: #1d2327;
    max-width: 300px; min-width: 180px;
}

.wpsummarize-bg-toggle {
    display: flex; border: 1px solid #8c8f94;
    border-radius: 4px; overflow: hidden;
}

.wpsummarize-bg-toggle button {
    padding: 4px 10px; font-size: 11px; border: none;
    border-right: 1px solid #8c8f94;
    cursor: pointer; background: #fff; color: #646970;
    transition: background-color 0.15s ease, color 0.15s ease;
    line-height: 1.5;
}

.wpsummarize-bg-toggle button:last-child { border-right: none; }
.wpsummarize-bg-toggle button:hover { background: #f0f0f1; }
.wpsummarize-bg-toggle button.active { background: #2271b1; color: #fff; }

.wpsummarize-preview-area {
    padding: 30px; min-height: 160px;
    transition: background-color 0.25s ease;
    display: flex; justify-content: center;
}

.wpsummarize-bg-light { background: #ffffff; }
.wpsummarize-bg-grey  { background: #f0f0f1; }
.wpsummarize-bg-dark  { background: #1d2327; }

.wpsummarize-preview-content {
    max-width: 700px; width: 100%;
    transition: opacity 0.2s ease;
}

.wpsummarize-preview-content.wpsummarize-preview-fading { opacity: 0; }

.wpsummarize-preview-loading {
    display: flex; align-items: center; gap: 8px;
    color: #646970; font-size: 13px; padding: 20px 0;
}

.wpsummarize-preview-loading .spinner { float: none; margin: 0; }

.wpsummarize-preview-source-note {
    display: flex; align-items: center; gap: 6px;
    margin-top: 12px; padding: 8px 12px;
    background: #f0f6fc; border: 1px solid #c5d9ed;
    border-radius: 4px; font-size: 12px; color: #2271b1;
}


/* ---------------------------------------------
   CUSTOMIZATION PANEL
   --------------------------------------------- */

.wpsummarize-customize-wrapper { margin-top: 16px; }

.wpsummarize-customize-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: #f6f7f7; border: 1px solid #dcdcde; border-radius: 4px;
    cursor: pointer; font-size: 13px; font-weight: 500; color: #1d2327;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.wpsummarize-customize-toggle:hover {
    background: #f0f0f1; border-color: #8c8f94;
}

.wpsummarize-customize-toggle .dashicons {
    font-size: 16px; width: 16px; height: 16px; line-height: 16px;
}

.wpsummarize-customize-arrow { margin-left: 4px; }

.wpsummarize-customize-panel {
    margin-top: 12px; padding: 20px;
    background: #f6f7f7; border: 1px solid #dcdcde; border-radius: 4px;
}

.wpsummarize-customize-description {
    color: #646970; font-size: 13px; margin: 0 0 18px 0;
}

.wpsummarize-customize-divider {
    border: none;
    border-top: 1px solid #dcdcde;
    margin: 18px 0;
}

.wpsummarize-customize-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}

.wpsummarize-customize-section h4 {
    font-size: 13px; font-weight: 600; color: #1d2327;
    margin: 0 0 12px 0; padding-bottom: 6px;
    border-bottom: 1px solid #dcdcde;
}

.wpsummarize-control-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px; gap: 10px;
}

.wpsummarize-control-row label {
    font-size: 13px; color: #1d2327;
    white-space: nowrap; min-width: 110px;
}

.wpsummarize-control-input {
    display: flex; align-items: center; gap: 6px;
}

.wpsummarize-control-input input[type="color"] {
    width: 36px; height: 28px;
    border: 1px solid #8c8f94; border-radius: 3px;
    padding: 1px; cursor: pointer; background: #fff;
}

.wpsummarize-control-slider { flex: 1; }

.wpsummarize-control-slider input[type="range"] {
    width: 120px; cursor: pointer; accent-color: #2271b1;
}

.wpsummarize-slider-value {
    font-size: 12px; color: #646970;
    min-width: 40px; text-align: right;
    font-variant-numeric: tabular-nums;
}

.wpsummarize-reset-control {
    width: 22px; height: 22px; padding: 0;
    border: 1px solid #dcdcde; border-radius: 3px;
    background: #fff; color: #a7aaad;
    font-size: 14px; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.wpsummarize-reset-control:hover {
    color: #d63638; border-color: #d63638;
}


/* ---------------------------------------------
   AI STYLE MATCH
   --------------------------------------------- */

.wpsummarize-ai-match {
    background: #fff;
    border: 1px solid #c5d9ed;
    border-radius: 6px;
    padding: 16px 18px;
    border-left: 4px solid #2271b1;
    margin-top:20px;
}

.wpsummarize-ai-match-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.wpsummarize-ai-match-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
}

.wpsummarize-ai-match-info > .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: #2271b1;
    margin-top: 1px;
    flex-shrink: 0;
}

.wpsummarize-ai-match-info strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 3px;
}

.wpsummarize-ai-match-info p {
    margin: 0;
    font-size: 12px;
    color: #646970;
    line-height: 1.5;
}

/* Match button */
#wpsummarize-ai-match-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    padding: 6px 14px;
    font-weight: 500;
    flex-shrink: 0;
}

#wpsummarize-ai-match-btn .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    line-height: 15px;
}

#wpsummarize-ai-match-btn.wpsummarize-ai-loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status bar */
.wpsummarize-ai-match-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e8e8e8;
    font-size: 13px;
    color: #646970;
}

.wpsummarize-ai-match-status .spinner {
    float: none;
    margin: 0;
}

.wpsummarize-ai-match-status-text.wpsummarize-ai-error {
    color: #d63638;
}

.wpsummarize-ai-match-status-text.wpsummarize-ai-success {
    color: #00a32a;
}


/* ---------------------------------------------
   CSS OUTPUT AREA
   --------------------------------------------- */

.wpsummarize-css-output-wrapper {
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid #dcdcde;
}

.wpsummarize-css-output-wrapper h4 {
    font-size: 13px; font-weight: 600; color: #1d2327;
    margin: 0 0 8px 0;
}

.wpsummarize-css-output {
    width: 100%;
    font-family: Menlo, Consolas, Monaco, "Liberation Mono", monospace;
    font-size: 12px; line-height: 1.5;
    padding: 12px;
    background: #fff; border: 1px solid #8c8f94; border-radius: 4px;
    color: #1d2327; resize: vertical; tab-size: 4;
}

.wpsummarize-css-output:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.wpsummarize-css-output-actions {
    display: flex; align-items: center;
    gap: 8px; margin-top: 10px; flex-wrap: wrap;
}

.wpsummarize-css-output-actions .button {
    display: inline-flex; align-items: center; gap: 4px;
}

.wpsummarize-css-output-actions .button .dashicons {
    font-size: 14px; width: 14px; height: 14px; line-height: 14px;
}

.wpsummarize-css-output-status {
    font-size: 12px; margin-left: 4px;
    transition: opacity 0.3s ease;
}

.wpsummarize-css-output-status.success { color: #00a32a; }
.wpsummarize-css-output-status.warning { color: #dba617; }


/* ---------------------------------------------
   FLASH EFFECT
   --------------------------------------------- */

@keyframes wpsummarize-flash {
    0%   { background-color: #fff; }
    20%  { background-color: #e7f5e8; }
    100% { background-color: #fff; }
}

.wpsummarize-flash {
    animation: wpsummarize-flash 1.5s ease;
}


/* ---------------------------------------------
   RESPONSIVE
   --------------------------------------------- */

@media screen and (max-width: 782px) {
    .wpsummarize-theme-thumb { width: 90px; }
    .wpsummarize-theme-thumb-image { height: 56px; }

    .wpsummarize-preview-toolbar {
        flex-direction: column; align-items: flex-start;
    }

    .wpsummarize-preview-post-select { max-width: 100%; width: 100%; }
    .wpsummarize-preview-area { padding: 20px 15px; }

    .wpsummarize-customize-grid {
        grid-template-columns: 1fr; gap: 16px;
    }

    .wpsummarize-control-row {
        flex-direction: column; align-items: flex-start; gap: 4px;
    }

    .wpsummarize-control-slider input[type="range"] { width: 100%; }

    .wpsummarize-ai-match-inner {
        flex-direction: column; align-items: flex-start;
    }
}

.wpsummarize-theme-list-compact {
    display: flex; flex-wrap: wrap; gap: 4px 16px;
}
.wpsummarize-theme-list-item {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; color: #1d2327; cursor: pointer; padding: 2px 0;
}