/**
 * SearchJet Index Settings Page Styles
 */

.searchjet-admin-wrap {
    max-width: 900px;
    margin: 20px auto;
}

.searchjet-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.searchjet-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.searchjet-card h2 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    color: #667eea;
    font-size: 20px;
}

.searchjet-card h3 {
    margin: 25px 0 10px 0;
    color: #333;
    font-size: 16px;
}

.searchjet-card h3:first-of-type {
    margin-top: 0;
}

.searchjet-stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.searchjet-stats-card h2 {
    border-bottom-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.searchjet-stats-card .notice {
    background: rgba(255, 255, 255, 0.9);
    border-left-color: #667eea;
}

/* Form sections */
.form-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.description {
    color: #666;
    font-size: 13px;
    margin: 8px 0 15px 0;
    line-height: 1.5;
}

/* Attributes list */
.attributes-list {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
    min-height: 50px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.attribute-tag {
    display: inline-flex;
    align-items: center;
    background: #667eea;
    color: white;
    padding: 6px 12px;
    margin: 3px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.attribute-tag .remove {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    transition: transform 0.2s;
}

.attribute-tag .remove:hover {
    transform: scale(1.2);
}

/* Attribute input */
.attribute-input {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.attribute-input-field {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
}

.attribute-input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-tag-btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* Buttons */
.add-attribute-btn {
    margin-top: 12px;
    margin-bottom: 15px;
    background: #f5f5f5;
    border-color: #ddd;
    color: #333;
    transition: all 0.2s;
}

.add-attribute-btn:hover {
    background: #e8e8e8;
    border-color: #999;
    color: #333;
}

/* Textarea */
textarea[name="ranking_rules"] {
    font-family: "Courier New", monospace;
    font-size: 13px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
}

textarea[name="ranking_rules"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #667eea;
}

.stat-item.full-width {
    grid-column: 1 / -1;
}

.stat-item strong {
    display: block;
    color: #666;
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item span {
    display: block;
    font-size: 24px;
    color: #333;
    font-weight: bold;
}

/* Form actions */
.form-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-actions .button-primary {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
}

#save-status {
    font-weight: 600;
    color: #4caf50;
    font-size: 13px;
}

#save-status.error {
    color: #d32f2f;
}

#save-status small {
    display: block;
    font-weight: normal;
    color: #666;
    margin-top: 4px;
}

/* Info boxes */
.notice {
    border-radius: 4px;
    border-left-width: 4px;
    margin: 20px 0;
}

.notice.notice-info {
    border-left-color: #667eea;
    background-color: #f5f7ff;
}

.notice.notice-info p {
    color: #333;
    margin: 8px 0;
}

.notice strong {
    color: #667eea;
}

/* Loading state */
#searchjet-form-loading,
#searchjet-stats-loading {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .searchjet-card {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .button-primary {
        width: 100%;
    }

    .attribute-tag {
        font-size: 12px;
        padding: 5px 10px;
    }

    .attributes-list {
        padding: 10px;
        min-height: 40px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .searchjet-card {
        background: #2c2c2c;
        border-color: #444;
        color: #eee;
    }

    .searchjet-card h2,
    .searchjet-card h3 {
        color: #667eea;
    }

    .description {
        color: #aaa;
    }

    .attributes-list {
        background: #333;
        border-color: #444;
    }

    .attribute-input-field {
        background: #3c3c3c;
        border-color: #444;
        color: #eee;
    }

    .stat-item {
        background: #333;
        border-left-color: #667eea;
        color: #eee;
    }

    .stat-item strong {
        color: #aaa;
    }

    .stat-item span {
        color: #eee;
    }

    textarea[name="ranking_rules"] {
        background: #3c3c3c;
        border-color: #444;
        color: #eee;
    }
}
