/**
 * InstaRank Classic Editor Styles
 */

/* Metabox Container */
.instarank-classic-metabox {
    background: #fff;
    padding: 0;
    margin: -12px -12px 0;
}

/* Pending Changes Notice */
.instarank-pending-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #dbeafe;
    border-left: 4px solid #2563eb;
    margin: 0 0 16px 0;
    font-size: 14px;
}

.instarank-pending-notice .dashicons {
    color: #2563eb;
    flex-shrink: 0;
}

.instarank-pending-notice a {
    color: #2563eb;
    text-decoration: underline;
    margin-left: 4px;
}

/* Tabs */
.instarank-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    margin: 0;
    padding: 0 16px;
}

.instarank-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.instarank-tab:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
}

.instarank-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #fff;
}

.instarank-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Tab Content */
.instarank-tab-content {
    display: none;
    padding: 20px 16px;
}

.instarank-tab-content.active {
    display: block;
}

.instarank-tab-content h4 {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.instarank-tab-content hr {
    margin: 24px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

/* Fields */
.instarank-field {
    margin-bottom: 20px;
}

.instarank-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
}

.instarank-field input[type="text"],
.instarank-field input[type="url"],
.instarank-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.instarank-field input[type="text"]:focus,
.instarank-field input[type="url"]:focus,
.instarank-field textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.instarank-field .description {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

/* Character Counter */
.instarank-char-counter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
}

.instarank-char-counter .count {
    font-weight: 600;
    color: #6b7280;
    min-width: 60px;
}

.instarank-char-counter .bar {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.instarank-char-counter .fill {
    height: 100%;
    background: #10b981;
    transition: all 0.3s ease;
}

/* Character counter states */
.instarank-char-counter.status-short .count {
    color: #d97706;
}

.instarank-char-counter.status-short .fill {
    background: #d97706;
}

.instarank-char-counter.status-good .count {
    color: #059669;
}

.instarank-char-counter.status-good .fill {
    background: #10b981;
}

.instarank-char-counter.status-too-long .count {
    color: #dc2626;
}

.instarank-char-counter.status-too-long .fill {
    background: #dc2626;
}

/* SERP Preview */
.instarank-serp-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.serp-preview-container {
    font-family: Arial, sans-serif;
}

.serp-preview-url {
    font-size: 14px;
    color: #1a0dab;
    margin-bottom: 2px;
    word-break: break-all;
}

.serp-preview-title {
    font-size: 20px;
    color: #1a0dab;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 4px;
    cursor: pointer;
    word-wrap: break-word;
}

.serp-preview-title:hover {
    text-decoration: underline;
}

.serp-preview-description {
    font-size: 14px;
    color: #545454;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Keyword Analysis */
.instarank-keyword-analysis {
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.keyword-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: #6b7280;
}

.keyword-check .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.keyword-check.found {
    color: #059669;
}

.keyword-check.found .dashicons {
    color: #10b981;
}

.keyword-check.found .dashicons-minus::before {
    content: "\f147"; /* checkmark */
}

.keyword-check.not-found {
    color: #d97706;
}

.keyword-check.not-found .dashicons {
    color: #f59e0b;
}

.keyword-check.not-found .dashicons-minus::before {
    content: "\f335"; /* warning */
}

/* Social Previews */
.instarank-social-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.social-preview-image {
    width: 100%;
    height: 250px;
    background: #e5e7eb;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
}

.social-preview-image::before {
    content: "No image selected";
}

.social-preview-image.has-image::before {
    content: "";
}

.social-preview-content {
    padding: 12px 16px;
    background: #fff;
}

.social-preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.3;
}

.social-preview-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 6px;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
}

.social-preview-url {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
}

/* Twitter Preview Variations */
.twitter-preview .social-preview-image {
    height: 200px;
}

/* Image Selector */
.instarank-image-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.instarank-image-selector .button {
    font-size: 13px;
}

.instarank-image-selector .image-preview {
    width: 100%;
    margin-top: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.instarank-image-selector .image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Checkboxes */
.instarank-field input[type="checkbox"] {
    margin-right: 6px;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .instarank-tabs {
        overflow-x: auto;
    }

    .instarank-tab {
        white-space: nowrap;
    }

    .instarank-tab-content {
        padding: 16px 12px;
    }
}
