/* String View Styles */

.string-view {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem;
}

.string-view__header {
    text-align: center;
    margin-bottom: 2rem;
}

.string-view__title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.string-view__description {
    color: #666;
    font-size: 0.9rem;
}

.string-view__content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Display Section */
.string-view__display {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.string-view__label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.string-view__string {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    word-break: break-all;
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
}

.string-view__face-group {
    display: inline-block;
    margin: 0 2px;
}

.string-view__separator {
    color: #999;
    margin: 0 4px;
    font-weight: bold;
}

.string-view__char {
    display: inline-block;
    padding: 2px 4px;
    margin: 1px;
    border-radius: 3px;
    font-weight: 600;
}

.string-view__char--u {
    background: #ffffff;
    color: #333;
    border: 1px solid #ddd;
}

.string-view__char--r {
    background: #ff3838;
    color: white;
}

.string-view__char--f {
    background: #00d084;
    color: white;
}

.string-view__char--d {
    background: #ffd500;
    color: #333;
}

.string-view__char--l {
    background: #ff8c00;
    color: white;
}

.string-view__char--b {
    background: #0051ba;
    color: white;
}

/* Editor Section */
.string-view__editor {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.string-view__input {
    width: 100%;
    min-height: 120px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    resize: vertical;
    transition: border-color 0.2s ease;
    background: white;
}

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

.string-view__char-count {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    text-align: right;
}

.string-view__char-count span {
    font-weight: 600;
    color: #333;
}

/* Actions */
.string-view__actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.string-view__btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.string-view__btn--apply {
    background: #28a745;
    color: white;
}

.string-view__btn--apply:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.string-view__btn--copy {
    background: #007bff;
    color: white;
}

.string-view__btn--copy:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.string-view__btn--reset {
    background: #6c757d;
    color: white;
}

.string-view__btn--reset:hover {
    background: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Validation Messages */
.string-view__validation {
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
    min-height: 20px;
}

.string-view__validation--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.string-view__validation--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.string-view__validation--warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Legend */
.string-view__legend {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e0e0e0;
}

.string-view__legend-title {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.75rem;
}

.string-view__legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.string-view__legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.string-view__legend-char {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.string-view__legend-text {
    font-size: 0.85rem;
    color: #555;
}

.string-view__legend-note {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .string-view {
        padding: 1rem;
    }

    .string-view__title {
        font-size: 1.25rem;
    }

    .string-view__string {
        font-size: 0.75rem;
        padding: 0.75rem;
    }

    .string-view__input {
        font-size: 0.9rem;
        min-height: 100px;
    }

    .string-view__actions {
        grid-template-columns: 1fr;
    }

    .string-view__legend-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .string-view__string {
        font-size: 0.7rem;
    }

    .string-view__legend-grid {
        grid-template-columns: 1fr;
    }
}
