/* SafeFonts Free Admin Styles */

.safefonts-admin-wrap {
    max-width: 1200px;
    margin: 20px 0;
}

.safefonts-admin-wrap h1 {
    color: #23282d;
    margin-bottom: 20px;
}

.safefonts-admin-title {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: 12px;
}

.safefonts-admin-title img {
    height: 32px !important;
    width: auto !important;
    max-height: 32px !important;
    max-width: none !important;
    vertical-align: middle;
}

/* Upload Section */
.safefonts-upload-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.safefonts-upload-section h3 {
    margin-top: 0;
    color: #1d2327;
}

.safefonts-upload-section .description {
    color: #646970;
    margin-bottom: 15px;
}

/* Progress Bar */
.safefonts-progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.safefonts-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00a32a, #00ba37);
    width: 0%;
    transition: width 0.3s ease;
}

.safefonts-progress-text {
    text-align: center;
    color: #646970;
    margin: 0;
}

/* Upload Result */
#safefonts-upload-result {
    margin-top: 15px;
}

#safefonts-upload-result .notice {
    margin: 0;
}

/* Fonts List */
.safefonts-fonts-list {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.safefonts-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f1;
}

.safefonts-list-header h3 {
    margin: 0;
}

.safefonts-bulk-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.safefonts-bulk-actions label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #1d2327;
}

.safefonts-bulk-actions input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
}

#safefonts-delete-selected {
    background: #d63638 !important;
    border-color: #d63638 !important;
    color: #fff !important;
}

#safefonts-delete-selected:hover:not(:disabled) {
    background: #b32d2e !important;
    border-color: #b32d2e !important;
}

#safefonts-delete-selected:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.safefonts-font-family {
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.safefonts-font-family:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.safefonts-family-name {
    font-size: 18px;
    margin: 0 0 15px 0;
    color: #1d2327;
    border-bottom: 2px solid #7515D5;
    padding-bottom: 5px;
    display: inline-block;
}

.safefonts-font-variants {
    display: grid;
    gap: 15px;
}

.safefonts-font-item {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.safefonts-font-info {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.safefonts-font-info input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.safefonts-font-info span {
    background: #7515D5;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.safefonts-font-weight {
    background: #f0b429 !important;
}

.safefonts-font-weight.safefonts-variable-font {
    background: linear-gradient(90deg, #f0b429 0%, #ff6b6b 100%) !important;
}

.safefonts-font-style {
    background: #00a32a !important;
}

.safefonts-font-format {
    background: #2271b1 !important;
}

.safefonts-font-size {
    background: #646970 !important;
}

.safefonts-font-preview {
    font-size: 18px;
    line-height: 1.4;
    padding: 10px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    color: #1d2327;
    width: 100%;
    box-sizing: border-box;
}

.safefonts-font-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.safefonts-delete-font {
    background: #d63638 !important;
    border-color: #d63638 !important;
    color: #fff !important;
}

.safefonts-delete-font:hover {
    background: #b32d2e !important;
    border-color: #b32d2e !important;
}

/* Settings Section */
.safefonts-settings-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.safefonts-settings-section h3 {
    margin-top: 0;
    color: #1d2327;
}

.safefonts-settings-section .form-table th {
    padding-left: 0;
}

/* System Info */
.safefonts-system-info {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.safefonts-system-info h3 {
    margin-top: 0;
    color: #1d2327;
}

.safefonts-system-info .form-table th {
    padding-left: 0;
    font-weight: 600;
}

.safefonts-system-info code {
    background: #f6f7f7;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
}

.safefonts-status-ok {
    color: #00a32a;
    font-weight: 600;
}

.safefonts-status-error {
    color: #d63638;
    font-weight: 600;
}

/* Upgrade Notice */
.safefonts-upgrade-notice {
    background: #f3e8ff;
    border-left: 4px solid #7515D5;
    padding: 15px;
    margin: 20px 0;
}

.safefonts-upgrade-notice h4 {
    margin-top: 0;
    color: #7515D5;
}

.safefonts-upgrade-notice ul {
    margin: 10px 0 10px 20px;
}

.safefonts-upgrade-notice li {
    margin-bottom: 5px;
}

/* Tabs Navigation */
.safefonts-nav-tab-wrapper {
    border-bottom: 1px solid #c3c4c7;
    margin-bottom: 20px;
}

.safefonts-nav-tab {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-bottom: none;
    color: #646970;
    text-decoration: none;
    padding: 8px 12px;
    margin: 0 5px 0 0;
    display: inline-block;
    border-radius: 4px 4px 0 0;
}

.safefonts-nav-tab:hover {
    background: #fff;
    color: #2271b1;
}

.safefonts-nav-tab-active {
    background: #fff;
    border-bottom: 1px solid #fff;
    color: #2271b1;
    margin-bottom: -1px;
}

.safefonts-tab-content {
    margin-top: 20px;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .safefonts-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .safefonts-bulk-actions {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    #safefonts-delete-selected {
        width: 100%;
    }

    .safefonts-font-info {
        flex-direction: column;
        gap: 8px;
    }

    .safefonts-font-actions {
        flex-direction: column;
    }

    .safefonts-font-actions .button {
        text-align: center;
    }
}

/* Loading States */
.safefonts-loading {
    opacity: 0.6;
    pointer-events: none;
}

.safefonts-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: safefonts-spin 1s linear infinite;
}

@keyframes safefonts-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Messages */
.safefonts-error {
    background: #fcf2f2;
    border-left: 4px solid #d63638;
    padding: 12px;
    margin: 15px 0;
}

.safefonts-success {
    background: #f0f6fc;
    border-left: 4px solid #00a32a;
    padding: 12px;
    margin: 15px 0;
}

/* Instructions Section */
.safefonts-instructions ol {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
}

.safefonts-instructions li {
    counter-increment: step-counter;
    margin-bottom: 20px;
    padding: 15px;
    background: #f6f7f7;
    border-left: 4px solid #2271b1;
    position: relative;
}

.safefonts-instructions li::before {
    content: counter(step-counter);
    position: absolute;
    left: -12px;
    top: 15px;
    background: #2271b1;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

/* Gutenberg Info */
.safefonts-gutenberg-info {
    background: #f3e8ff;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #7515D5;
}

.safefonts-gutenberg-info ul {
    margin: 10px 0;
}

.safefonts-gutenberg-info li {
    margin-bottom: 5px;
}

/* Dashboard Page Styles */
.safefonts-dashboard {
    max-width: 1200px;
}

.safefonts-dashboard-hero {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #7515D5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.safefonts-dashboard-hero h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.safefonts-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.safefonts-stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-top: 3px solid #7515D5;
}

.safefonts-stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #7515D5;
    margin-bottom: 5px;
}

.safefonts-stat-label {
    color: #666;
    font-size: 14px;
}

.safefonts-dashboard-actions {
    margin-bottom: 30px;
}

.safefonts-action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.safefonts-action-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: block;
}

.safefonts-action-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.safefonts-action-card .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #7515D5;
    margin-bottom: 10px;
}

.safefonts-action-card h4 {
    margin: 10px 0 5px 0;
    color: #23282d;
    font-size: 16px;
}

.safefonts-action-card p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.safefonts-dashboard-getting-started {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #7515D5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.safefonts-steps {
    margin: 15px 0;
    padding-left: 20px;
}

.safefonts-steps li {
    margin-bottom: 15px;
}

.safefonts-steps p {
    margin: 5px 0 0 0;
    color: #666;
}

.safefonts-dashboard-features {
    margin-bottom: 30px;
}

.safefonts-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.safefonts-feature {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.safefonts-feature .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #7515D5;
    margin-bottom: 10px;
}

.safefonts-feature h4 {
    margin: 10px 0 5px 0;
    font-size: 16px;
}

.safefonts-feature p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.safefonts-dashboard-upgrade {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #7515D5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.safefonts-dashboard-upgrade h3 {
    color: #7515D5;
    margin-top: 0;
}

.safefonts-pro-features {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.safefonts-pro-features li {
    margin-bottom: 8px;
    font-size: 15px;
}

.safefonts-dashboard-upgrade .button-primary {
    background: #7515D5;
    color: white;
    border-color: #7515D5;
    font-weight: 600;
}

.safefonts-dashboard-upgrade .button-primary:hover {
    background: #5a0fa5;
    color: white;
    border-color: #5a0fa5;
}

/* Help Page Styles */
.safefonts-help-page {
    max-width: 1000px;
}

.safefonts-help-toc {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #7515D5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.safefonts-help-toc h2 {
    margin-top: 0;
    color: #23282d;
    font-size: 22px;
}

.safefonts-help-toc-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.safefonts-help-toc-list li {
    margin: 0;
    flex: 0 0 auto;
}

.safefonts-help-toc-list a {
    display: inline-block;
    padding: 10px 20px;
    background: #f6f7f7;
    border-radius: 4px;
    text-decoration: none;
    color: #7515D5;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.safefonts-help-toc-list a:hover {
    background: #7515D5;
    color: white;
    transform: scale(1.05);
}

.safefonts-help-section {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.safefonts-help-section h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #7515D5;
    color: #23282d;
}

.safefonts-help-section h3 {
    color: #7515D5;
    margin-top: 25px;
    margin-bottom: 10px;
}

.safefonts-help-section h4 {
    color: #23282d;
    margin-top: 20px;
    margin-bottom: 10px;
}

.safefonts-help-section p {
    line-height: 1.6;
    color: #50575e;
}

.safefonts-help-section ul,
.safefonts-help-section ol {
    line-height: 1.8;
    color: #50575e;
}

.safefonts-help-section code {
    background: #f6f7f7;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
    font-size: 90%;
    color: #d63638;
}

.safefonts-help-tip {
    background: #f3e8ff;
    border-left: 4px solid #7515D5;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.safefonts-help-tip strong {
    color: #7515D5;
}

.safefonts-help-support {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #7515D5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.safefonts-help-support h2 {
    color: #7515D5;
    margin-top: 0;
}

.safefonts-help-support-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.safefonts-help-support-option {
    background: #f6f7f7;
    padding: 20px;
    border-radius: 8px;
}

.safefonts-help-support-option h3 {
    margin-top: 0;
    color: #23282d;
    font-size: 18px;
}

.safefonts-help-support-option p {
    margin: 10px 0;
    color: #646970;
}

.safefonts-help-support-option a {
    color: #7515D5;
    text-decoration: none;
    font-weight: 600;
}

.safefonts-help-support-option a:hover {
    color: #5a0fa5;
    text-decoration: underline;
}

/* Global Button Styling - Override WordPress defaults on SafeFonts pages */
.safefonts-admin-wrap .button-primary,
.safefonts-upload-section .button-primary,
.safefonts-settings-section .button-primary {
    background: #7515D5;
    border-color: #7515D5;
    color: #fff;
    text-shadow: none;
    box-shadow: none;
}

.safefonts-admin-wrap .button-primary:hover,
.safefonts-upload-section .button-primary:hover,
.safefonts-settings-section .button-primary:hover {
    background: #5a0fa5;
    border-color: #5a0fa5;
    color: #fff;
}

.safefonts-admin-wrap .button-primary:active,
.safefonts-upload-section .button-primary:active,
.safefonts-settings-section .button-primary:active {
    background: #5a0fa5;
    border-color: #5a0fa5;
}

.safefonts-admin-wrap .button-primary:focus,
.safefonts-upload-section .button-primary:focus,
.safefonts-settings-section .button-primary:focus {
    background: #7515D5;
    border-color: #7515D5;
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #7515D5;
}

/* ============================================
   CSS Tab System for Help Page
   ============================================ */

/* Hide radio buttons */
.safefonts-tab-radio {
    display: none !important;
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Tab Navigation */
.safefonts-help-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
    padding: 0;
    border-bottom: 2px solid #dcdcde;
}

/* Tab Labels (Buttons) */
.safefonts-tab-label {
    padding: 12px 20px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: #50575e;
    transition: all 0.2s ease;
    margin-bottom: -2px;
    user-select: none;
}

.safefonts-tab-label:hover {
    background: #fff;
    color: #7515D5;
    border-color: #7515D5;
}

/* Active Tab Label */
#tab-getting-started:checked ~ .safefonts-help-tab-nav label[for="tab-getting-started"],
#tab-uploading-fonts:checked ~ .safefonts-help-tab-nav label[for="tab-uploading-fonts"],
#tab-using-fonts:checked ~ .safefonts-help-tab-nav label[for="tab-using-fonts"],
#tab-managing-fonts:checked ~ .safefonts-help-tab-nav label[for="tab-managing-fonts"],
#tab-settings:checked ~ .safefonts-help-tab-nav label[for="tab-settings"],
#tab-troubleshooting:checked ~ .safefonts-help-tab-nav label[for="tab-troubleshooting"],
#tab-faq:checked ~ .safefonts-help-tab-nav label[for="tab-faq"] {
    background: #fff;
    color: #7515D5;
    border-color: #7515D5;
    border-bottom-color: #fff;
    font-weight: 600;
}

/* Tab Content Wrapper */
.safefonts-help-tab-wrapper {
    background: #fff;
    border: 1px solid #dcdcde;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding: 30px;
    margin-bottom: 30px;
}

/* Tab Content - Hide by default */
.safefonts-help-tab-content {
    display: none !important;
}

/* Show tab content when corresponding radio is checked */
#tab-getting-started:checked ~ .safefonts-help-tab-wrapper .safefonts-help-tab-content[data-tab="tab-getting-started"],
#tab-uploading-fonts:checked ~ .safefonts-help-tab-wrapper .safefonts-help-tab-content[data-tab="tab-uploading-fonts"],
#tab-using-fonts:checked ~ .safefonts-help-tab-wrapper .safefonts-help-tab-content[data-tab="tab-using-fonts"],
#tab-managing-fonts:checked ~ .safefonts-help-tab-wrapper .safefonts-help-tab-content[data-tab="tab-managing-fonts"],
#tab-settings:checked ~ .safefonts-help-tab-wrapper .safefonts-help-tab-content[data-tab="tab-settings"],
#tab-troubleshooting:checked ~ .safefonts-help-tab-wrapper .safefonts-help-tab-content[data-tab="tab-troubleshooting"],
#tab-faq:checked ~ .safefonts-help-tab-wrapper .safefonts-help-tab-content[data-tab="tab-faq"] {
    display: block !important;
}

/* Tab Content Styling */
.safefonts-help-tab-content h2 {
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #7515D5;
    color: #1d2327;
}

.safefonts-help-tab-content h3 {
    color: #1d2327;
    margin-top: 25px;
    margin-bottom: 12px;
}

.safefonts-help-tab-content ol,
.safefonts-help-tab-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.safefonts-help-tab-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.safefonts-help-tab-content p {
    margin: 12px 0;
    line-height: 1.6;
}