/**
 * Admin Page Styles
 * Headline Ligatures & Styles Plugin
 */

.typost-admin-wrap {
    max-width: 1200px;
}

.typost-admin-container {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin-top: 20px;
}

.typost-admin-tabs {
    border-bottom: 1px solid #ccd0d4;
    background: #f6f7f7;
    display: flex;
}

.typost-tab-button {
    background: none;
    border: none;
    padding: 15px 20px;
    min-height: 44px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.typost-tab-button:hover {
    background: #fff;
}

.typost-tab-button.active {
    background: #fff;
    border-bottom-color: #2271b1;
    font-weight: 600;
}

.typost-tab-button:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
    box-shadow: inset 0 0 0 1px #2271b1;
}

.typost-tab-content {
    display: none;
    padding: 30px;
}

.typost-tab-content.active {
    display: block;
    background: #FAF9F6;
}

.typost-preset-controls {
    margin: 20px 0;
    padding: 20px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.typost-preset-font-selector {
    margin: 0 15px 20px 15px;
}

.typost-preset-font-selector:last-child {
    margin-bottom: 0;
}

.typost-preset-font-selector label,
.typost-preset-size-control label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.typost-font-select {
    max-width: 400px;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}

.typost-font-select:focus {
    outline: 2px solid #2271b1;
    outline-offset: 0;
}

.typost-preset-font-selector .description,
.typost-preset-size-control .description {
    margin-top: 8px;
    color: #646970;
    font-size: 13px;
}

.typost-preset-size-control {
    margin: 20px 15px 0 15px;
}

.typost-size-value {
    display: inline-block;
    min-width: 50px;
    text-align: right;
    color: #2271b1;
    font-weight: 700;
    margin-left: 8px;
}

.typost-size-slider {
    width: 100%;
    max-width: 400px;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    outline: none;
    border-radius: 4px;
    margin-bottom: 8px;
}

.typost-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #2271b1;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.typost-size-slider::-webkit-slider-thumb:hover {
    background: #135e96;
}

.typost-size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2271b1;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    transition: background 0.2s;
}

.typost-size-slider::-moz-range-thumb:hover {
    background: #135e96;
}

.typost-size-slider:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.typost-size-slider:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.3);
}

.typost-size-slider:focus::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.3);
}

/* Baseline Preview Section */
.typost-baseline-preview-section {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.typost-baseline-preview-section h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #1d2327;
}

.typost-baseline-preview-section .description {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 13px;
}

.typost-baseline-preview-container {
    background: #fff;
    border: 2px solid #2271b1;
    border-radius: 4px;
    padding: 30px;
    overflow: hidden;
}

.typost-baseline-preview {
    font-size: 50px;
    line-height: 1.4;
    text-align: center;
    font-family: Georgia, serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: #1d2327;
    hyphens: auto;
}

/* Feature Category Section */
.typost-feature-category-section {
    margin: 30px 0;
    border-bottom: 1px solid #ddd;
}

.typost-feature-category-section:last-of-type {
    border-bottom: none;
}

/* Collapsible summary styles */
.typost-feature-category-summary {
    cursor: pointer;
    list-style: none;
    margin-bottom: 20px;
}

/* Remove default marker/disclosure triangle */
.typost-feature-category-summary::-webkit-details-marker,
.typost-feature-category-summary::marker {
    display: none;
}

.typost-feature-category-summary:focus {
    outline: 2px solid #2271b1;
    outline-offset: 8px;
}

/* Style the h3 to include the arrow */
.typost-feature-category-section > summary > h3,
.typost-feature-category-section > .typost-feature-category-summary > h3 {
    color: #2271b1;
    font-size: 18px;
    margin: 0;
    padding-bottom: 16px;
    padding-left: 30px;
    border-bottom: 2px solid #2271b1;
    position: relative;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
}

/* Add arrow before h3 */
.typost-feature-category-section > summary > h3::before,
.typost-feature-category-section > .typost-feature-category-summary > h3::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: #2271b1;
    transition: transform 0.2s;
    display: inline-block;
    width: 20px;
}

/* Rotate arrow when open */
.typost-feature-category-section[open] > summary > h3::before,
.typost-feature-category-section[open] > .typost-feature-category-summary > h3::before {
    transform: rotate(90deg);
}

.typost-feature-category-summary:hover > h3 {
    opacity: 0.8;
}

/* Legacy support for non-collapsible sections */
.typost-feature-category-section > h3 {
    color: #2271b1;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2271b1;
}

/* Feature Demos Grid */
.typost-feature-demos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.typost-feature-demo-card {
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 6px;
    background: #fafafa;
    transition: box-shadow 0.2s;
}

.typost-feature-demo-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.typost-feature-demo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.typost-feature-demo-header h4 {
    margin: 0;
    font-size: 15px;
    color: #1d2327;
}

.typost-feature-demo-header .typost-feature-code {
    background: #2271b1;
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.typost-feature-demo-description {
    color: #666;
    font-size: 13px;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

/* Feature Comparison */
.typost-feature-comparison {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.typost-feature-preview-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    flex: 1 1 150px;
    min-width: 0;
}

.typost-feature-preview-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.typost-feature-preview {
    font-size: 54px;
    line-height: 1.2;
    text-align: center;
    padding: 20px;
    font-family: Georgia, serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    hyphens: auto;
}

.typost-feature-preview-off {
    color: #666;
}

.typost-feature-preview-on {
    color: #1d2327;
    font-weight: 500;
    width: 100%;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    box-sizing: border-box;
}

/* User Presets Section */
.typost-user-presets-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid #2271b1;
}

.typost-user-presets-section > h3 {
    color: #2271b1;
    font-size: 18px;
    margin-bottom: 15px;
}

.typost-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.typost-preset-card {
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 4px;
    background: #fafafa;
}

.typost-preset-card h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.typost-preset-description {
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
}

.typost-preset-features {
    font-size: 12px;
    margin-bottom: 15px;
    padding: 8px;
    background: #fff;
    border-radius: 3px;
}

.typost-preset-preview {
    font-size: 50px;
    padding: 15px;
    background: #fff;
    border-radius: 3px;
    text-align: center;
    font-family: Georgia, serif;
    line-height: 1.2;
}

.typost-features-list {
    margin-top: 20px;
}

.typost-feature-category {
    margin-bottom: 30px;
}

.typost-feature-category h3 {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #2271b1;
}

.typost-feature-category table code {
    background: #f0f0f1;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.typost-help-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.typost-help-section:last-child {
    border-bottom: none;
}

.typost-help-section h3 {
    color: #2271b1;
}

.typost-help-section ul, .typost-help-section ol {
    line-height: 1.8;
}

.typost-add-preset-section {
    margin-top: 30px;
    padding: 20px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
}

/* Fonts Tab Styles */
.typost-fonts-list {
    margin: 20px 0;
}

.typost-font-card {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    background: #fafafa;
}

/* Kit grouping styles */
.typost-font-kit-card {
    border: 1px solid #c3c4c7;
    margin-bottom: 20px;
    border-radius: 4px;
    background: #fff;
}

.typost-font-kit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f0f0f1;
    border-bottom: 1px solid #c3c4c7;
}

.typost-font-kit-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.typost-toggle-kit {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1d2327;
}

.typost-toggle-kit:hover {
    color: #2271b1;
}

.typost-toggle-kit:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
    border-radius: 2px;
}

.typost-toggle-kit .dashicons {
    transition: transform 0.2s;
}

.typost-kit-font-count {
    font-size: 13px;
    font-weight: 400;
    color: #646970;
}

.typost-kit-fonts {
    padding: 15px;
    background: #f6f7f7;
}

.typost-kit-fonts .typost-font-card {
    background: #fff;
    border: 1px solid #ddd;
}

.typost-kit-font .typost-font-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.typost-font-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.typost-font-header h4 {
    margin: 0;
    font-size: 16px;
}

.typost-font-families {
    padding: 10px;
    background: #fff;
    border-radius: 3px;
    margin-bottom: 10px;
    font-size: 13px;
}

.typost-font-meta {
    color: #666;
    font-size: 12px;
}

.typost-upload-font-section {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.typost-upload-form {
    margin: 20px 0;
}

.typost-form-field {
    margin-bottom: 15px;
}

.typost-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.typost-font-help {
    margin-top: 30px;
    padding: 15px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
}

.typost-font-help h4 {
    margin-top: 0;
}

.typost-font-help ol {
    line-height: 1.8;
}

.typost-empty-state {
    padding: 40px;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

.typost-upload-method-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.typost-upload-method-buttons .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 44px;
}

.typost-upload-method-buttons .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.typost-or-separator {
    color: #666;
    font-style: italic;
    font-size: 13px;
}

.typost-selected-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f6fc;
    border: 1px solid #2271b1;
    border-radius: 3px;
    margin-bottom: 10px;
}

.typost-selected-file .dashicons-media-document {
    color: #2271b1;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.typost-selected-file #typost-file-name {
    flex: 1;
    font-weight: 500;
    color: #2271b1;
}

.typost-selected-file .button-link {
    color: #b32d2e;
    text-decoration: none;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

.typost-selected-file .button-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.typost-selected-file .button-link:hover {
    color: #dc3232;
}

.typost-file-size {
    color: #666;
    font-size: 12px;
    margin-left: 8px;
}

.typost-upload-progress {
    margin-top: 15px;
}

.typost-progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f1;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.typost-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #135e96 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typost-progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

.typost-selected-file .dashicons-media-archive {
    color: #2271b1;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Accessibility helpers */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, .6);
    clip: auto !important;
    clip-path: none;
    color: #0073aa;
    display: block;
    font-size: 14px;
    font-weight: 600;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

#typost-upload-font-btn,
#typost-select-file-btn,
#typost-clear-file-btn {
    min-height: 44px;
    min-width: 44px;
}

.typost-font-section, .typost-fontsize-section {
    margin: 0 1rem;
}

/* Adobe Fonts Section */
.typost-adobe-fonts-section {
    margin-top: 40px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.typost-adobe-fonts-section h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2271b1;
}

.typost-adobe-fonts-list {
    margin: 20px 0;
}

.typost-adobe-fonts-list h4 {
    font-size: 15px;
    margin-bottom: 15px;
}

.typost-adobe-font-card {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    background: #f8fbff;
}

.typost-adobe-font-card h5 {
    margin: 0;
    font-size: 15px;
}

.typost-add-adobe-font-form {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.typost-add-adobe-font-form h4 {
    margin-top: 0;
}

.typost-adobe-help {
    margin-top: 30px;
    padding: 15px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.typost-adobe-help h4 {
    margin-top: 0;
}

.typost-adobe-help ol {
    line-height: 1.8;
}

.typost-delete-adobe-font {
    color: #b32d2e;
}

.typost-delete-adobe-font:hover {
    color: #d63638;
}

/* Manual Fonts Section */
.typost-manual-fonts-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #dcdcde;
}

.typost-manual-fonts-list {
    margin: 20px 0;
}

.typost-manual-font-card {
    background: #fff;
    border: 1px solid #dcdcde;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.typost-manual-font-card .typost-font-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.typost-manual-font-card h5 {
    margin: 0;
    font-size: 16px;
}

.typost-manual-font-card .typost-font-families,
.typost-manual-font-card .typost-font-fallbacks {
    margin: 10px 0;
}

.typost-manual-font-card .typost-font-families code,
.typost-manual-font-card .typost-font-fallbacks code {
    background: #f6f7f7;
    padding: 4px 8px;
    border-radius: 3px;
}

.typost-add-manual-font-form {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.typost-manual-help {
    margin-top: 30px;
    padding: 20px;
    background: #f0f6fc;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.typost-manual-help h4 {
    margin-top: 0;
}

.typost-manual-help ol {
    line-height: 1.8;
}

.typost-manual-help code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

.typost-delete-manual-font {
    color: #b32d2e;
}

.typost-delete-manual-font:hover {
    color: #d63638;
}

/* =========================================================================
   FONT DELETION MODAL & REPLACEMENT MANAGEMENT
   ========================================================================= */

.typost-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typost-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.typost-modal-content {
    position: relative;
    background: #fff;
    max-width: 500px;
    width: 90%;
    z-index: 2;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.typost-modal-header {
    padding: 20px;
    border-bottom: 1px solid #dcdcde;
    position: relative;
}

.typost-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.typost-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #50575e;
    padding: 5px 10px;
}

.typost-modal-close:hover {
    color: #135e96;
}

.typost-modal-body {
    padding: 20px;
}

.typost-modal-field {
    margin-bottom: 20px;
}

.typost-modal-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.typost-modal-field select {
    width: 100%;
}

.typost-modal-field .description {
    margin-top: 6px;
    font-size: 13px;
    color: #646970;
}

.typost-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #dcdcde;
    text-align: right;
}

.typost-modal-footer .button {
    margin-left: 10px;
}

/* Replacements table */
#typost-replacements-list table {
    margin-top: 20px;
}

#typost-replacements-list th {
    font-weight: 600;
}

.typost-no-replacements {
    padding: 40px 20px;
    text-align: center;
    color: #646970;
    background: #f6f7f7;
    border-radius: 4px;
}

#typost-unassigned-fonts {
    padding: 20px;
    background: #fcf9e8;
    border-left: 4px solid #dba617;
    border-radius: 4px;
}

#typost-unassigned-fonts h3 {
    margin-top: 0;
    color: #996800;
}

/* Developer Support Section */
.typost-developer-support {
    margin-top: 30px;
    background: #fffff0;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    padding: 20px;
    border-radius: 4px;
}

.typost-developer-support h3 {
    margin-top: 0;
    color: #2271b1;
}

.typost-developer-support .typost-separator {
    margin: 0 10px;
}

/* Available font weight checkboxes */
.typost-weight-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 8px;
}

.typost-weight-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 400 !important;
    cursor: pointer;
    min-width: 140px;
}

.typost-weight-checkbox-label input[type="checkbox"] {
    margin: 0;
}

/* Deep-link highlight animation for settings rows */
.typost-highlight-row {
    animation: typost-highlight-fade 3s ease-out;
}

@keyframes typost-highlight-fade {
    0% { background-color: #fff3cd; }
    70% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}
