/**
 * SERP Preview Tool - Feature Styles
 * Styles for Pixel Width, SEO Score, and Schema Generator features
 */

/* ===========================================
   PIXEL WIDTH MEASUREMENT
   =========================================== */

/* Enhanced Character Counter with Pixel Width */
.char-counter-enhanced {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.char-counter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.char-pixel-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.char-info,
.pixel-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.char-info .value,
.pixel-info .value {
    font-weight: 500;
}

.char-info .label,
.pixel-info .label {
    color: #5f6368;
}

.pixel-info {
    padding-left: 8px;
    border-left: 1px solid #e8eaed;
}

.char-info.good .value,
.pixel-info.good .value {
    color: #188038;
}

.char-info.warning .value,
.pixel-info.warning .value {
    color: #f9ab00;
}

.char-info.danger .value,
.pixel-info.danger .value {
    color: #d93025;
}

/* Pixel Progress Bar */
.pixel-progress-container {
    width: 100%;
}

.pixel-progress-bar {
    height: 4px;
    background: #e8eaed;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.pixel-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.2s ease, background-color 0.2s ease;
}

.pixel-progress-fill.good {
    background: #188038;
}

.pixel-progress-fill.warning {
    background: #f9ab00;
}

.pixel-progress-fill.danger {
    background: #d93025;
}

.pixel-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 11px;
    color: #9aa0a6;
}

/* ===========================================
   SEO SCORE
   =========================================== */

/* SEO Score Card */
.seo-score-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8eaed;
    margin-top: 20px;
    overflow: hidden;
}

.seo-score-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8eaed;
    cursor: pointer;
    user-select: none;
}

.seo-score-header:hover {
    background: #f1f3f4;
}

.seo-score-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seo-score-title {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
}

/* Score Badge */
.seo-score-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
}

.seo-score-badge.success {
    background: #e6f4ea;
    color: #188038;
}

.seo-score-badge.good {
    background: #e6f4ea;
    color: #188038;
}

.seo-score-badge.warning {
    background: #fef7e0;
    color: #f9ab00;
}

.seo-score-badge.danger {
    background: #fce8e6;
    color: #d93025;
}

/* Toggle Icon */
.seo-score-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #5f6368;
    transition: transform 0.2s ease;
}

.seo-score-toggle svg {
    width: 20px;
    height: 20px;
}

.seo-score-card.expanded .seo-score-toggle {
    transform: rotate(180deg);
}

/* Score Progress */
.seo-score-progress {
    padding: 0 16px 16px;
}

.seo-progress-bar {
    height: 8px;
    background: #e8eaed;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}

.seo-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.seo-progress-fill.success,
.seo-progress-fill.good {
    background: linear-gradient(90deg, #34a853 0%, #188038 100%);
}

.seo-progress-fill.warning {
    background: linear-gradient(90deg, #fbbc04 0%, #f9ab00 100%);
}

.seo-progress-fill.danger {
    background: linear-gradient(90deg, #ea4335 0%, #d93025 100%);
}

/* Score Details */
.seo-score-details {
    display: none;
    padding: 16px;
    border-top: 1px solid #e8eaed;
}

.seo-score-card.expanded .seo-score-details {
    display: block;
}

.seo-criteria-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.seo-criteria-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
}

.seo-criteria-item:last-child {
    border-bottom: none;
}

.seo-criteria-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.seo-criteria-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
}

.seo-criteria-icon.pass {
    background: #e6f4ea;
    color: #188038;
}

.seo-criteria-icon.warning {
    background: #fef7e0;
    color: #f9ab00;
}

.seo-criteria-icon.fail {
    background: #fce8e6;
    color: #d93025;
}

.seo-criteria-icon.neutral {
    background: #f1f3f4;
    color: #5f6368;
}

.seo-criteria-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.seo-criteria-name {
    font-size: 13px;
    color: #202124;
}

.seo-criteria-message {
    font-size: 11px;
    color: #5f6368;
}

.seo-criteria-points {
    font-size: 13px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f1f3f4;
    color: #5f6368;
}

.seo-criteria-points.earned {
    background: #e6f4ea;
    color: #188038;
}

/* ===========================================
   SCHEMA MARKUP GENERATOR
   =========================================== */

/* Schema Generator Button */
.btn-schema {
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: #fff;
}

.btn-schema:hover {
    background: linear-gradient(135deg, #1557b0 0%, #1a73e8 100%);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.4);
}

/* Schema Modal */
.schema-modal .modal-content {
    max-width: 700px;
}

.schema-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #e8f0fe;
    color: #1a73e8;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Code Block */
.schema-code-container {
    position: relative;
    margin: 16px 0;
}

.schema-code {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 16px;
    max-height: 400px;
    overflow: auto;
}

.schema-code pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Syntax Highlighting */
.schema-code .key {
    color: #9cdcfe;
}

.schema-code .string {
    color: #ce9178;
}

.schema-code .number {
    color: #b5cea8;
}

.schema-code .boolean {
    color: #569cd6;
}

.schema-code .bracket {
    color: #ffd700;
}

/* Schema Actions */
.schema-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.schema-actions .btn {
    flex: 1;
}

/* Validation Messages */
.schema-validation {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
}

.schema-validation.valid {
    background: #e6f4ea;
    border: 1px solid #34a853;
}

.schema-validation.invalid {
    background: #fce8e6;
    border: 1px solid #ea4335;
}

.schema-validation-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.schema-validation.valid .schema-validation-title {
    color: #188038;
}

.schema-validation.invalid .schema-validation-title {
    color: #d93025;
}

.schema-validation-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 12px;
}

.schema-validation-list li {
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.schema-validation-list li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.schema-validation.valid .schema-validation-list li::before {
    background: #188038;
}

.schema-validation.invalid .schema-validation-list li::before {
    background: #d93025;
}

/* ===========================================
   DARK MODE STYLES
   =========================================== */

/* Pixel Width Dark Mode */
body.dark-mode .pixel-info {
    border-left-color: #3c4043;
}

body.dark-mode .char-info .label,
body.dark-mode .pixel-info .label {
    color: #9aa0a6;
}

body.dark-mode .pixel-progress-bar {
    background: #3c4043;
}

body.dark-mode .pixel-progress-labels {
    color: #9aa0a6;
}

/* SEO Score Dark Mode */
body.dark-mode .seo-score-card {
    background: #292a2d;
    border-color: #3c4043;
}

body.dark-mode .seo-score-header {
    background: #202124;
    border-bottom-color: #3c4043;
}

body.dark-mode .seo-score-header:hover {
    background: #35363a;
}

body.dark-mode .seo-score-title {
    color: #e8eaed;
}

body.dark-mode .seo-score-badge.success,
body.dark-mode .seo-score-badge.good {
    background: #1e3a29;
    color: #81c995;
}

body.dark-mode .seo-score-badge.warning {
    background: #3d3523;
    color: #fdd663;
}

body.dark-mode .seo-score-badge.danger {
    background: #3c2125;
    color: #f28b82;
}

body.dark-mode .seo-score-toggle {
    color: #9aa0a6;
}

body.dark-mode .seo-progress-bar {
    background: #3c4043;
}

body.dark-mode .seo-score-details {
    border-top-color: #3c4043;
}

body.dark-mode .seo-criteria-item {
    border-bottom-color: #3c4043;
}

body.dark-mode .seo-criteria-icon.pass {
    background: #1e3a29;
    color: #81c995;
}

body.dark-mode .seo-criteria-icon.warning {
    background: #3d3523;
    color: #fdd663;
}

body.dark-mode .seo-criteria-icon.fail {
    background: #3c2125;
    color: #f28b82;
}

body.dark-mode .seo-criteria-icon.neutral {
    background: #3c4043;
    color: #9aa0a6;
}

body.dark-mode .seo-criteria-name {
    color: #e8eaed;
}

body.dark-mode .seo-criteria-message {
    color: #9aa0a6;
}

body.dark-mode .seo-criteria-points {
    background: #3c4043;
    color: #9aa0a6;
}

body.dark-mode .seo-criteria-points.earned {
    background: #1e3a29;
    color: #81c995;
}

/* Schema Generator Dark Mode */
body.dark-mode .schema-type-badge {
    background: #394457;
    color: #8ab4f8;
}

body.dark-mode .schema-code {
    background: #1e1e1e;
}

body.dark-mode .schema-validation.valid {
    background: #1e3a29;
    border-color: #34a853;
}

body.dark-mode .schema-validation.invalid {
    background: #3c2125;
    border-color: #ea4335;
}

body.dark-mode .schema-validation.valid .schema-validation-title {
    color: #81c995;
}

body.dark-mode .schema-validation.invalid .schema-validation-title {
    color: #f28b82;
}

body.dark-mode .schema-validation.valid .schema-validation-list li::before {
    background: #81c995;
}

body.dark-mode .schema-validation.invalid .schema-validation-list li::before {
    background: #f28b82;
}

/* ===========================================
   RESPONSIVE ADJUSTMENTS
   =========================================== */

@media (max-width: 600px) {
    .char-pixel-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .pixel-info {
        padding-left: 0;
        border-left: none;
    }

    .seo-score-header {
        padding: 12px;
    }

    .seo-score-badge {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .schema-actions {
        flex-direction: column;
    }

    .schema-code {
        max-height: 300px;
    }
}
