/* Hex.css - Scope all styles under .hex-app to prevent side effects on other pages */

.hex-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2d3748;
    max-width: 900px;
    margin: 10px auto 30px auto;
    padding: 0 10px;
}

.hex-app * {
    box-sizing: border-box;
}

/* Header Banner */
.hex-app .hex-header {
    background: linear-gradient(135deg, #0ba360 0%, #3cba92 100%);
    color: #ffffff;
    padding: 24px 28px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(11, 163, 96, 0.25);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.hex-app .hex-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.hex-app .hex-header-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 4px 0 0 0;
}

/* Main Card */
.hex-app .hex-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #edf2f7;
    margin-bottom: 24px;
}

/* Controls Grid (Charset & Format) */
.hex-app .hex-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.hex-app .hex-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hex-app .hex-control-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}

.hex-app .hex-radio-group {
    display: flex;
    gap: 8px;
}

.hex-app .hex-radio-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.hex-app .hex-radio-group label {
    padding: 6px 14px;
    background: #ffffff;
    border: 1.5px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.825rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hex-app .hex-radio-group label:hover {
    border-color: #0ba360;
    color: #0ba360;
}

.hex-app .hex-radio-group input[type="radio"]:checked + label {
    background: #0ba360;
    border-color: #0ba360;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(11, 163, 96, 0.25);
}

/* Textarea Workspace */
.hex-app .hex-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .hex-app .hex-workspace {
        grid-template-columns: 1fr;
    }
}

.hex-app .hex-panel {
    display: flex;
    flex-direction: column;
}

.hex-app .hex-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.hex-app .hex-panel-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hex-app .hex-panel-counter {
    font-size: 0.775rem;
    color: #a0aec0;
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 12px;
}

.hex-app .hex-textarea {
    width: 100%;
    min-height: 180px;
    padding: 14px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.925rem;
    line-height: 1.6;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #ffffff;
}

.hex-app .hex-textarea:focus {
    border-color: #0ba360;
    box-shadow: 0 0 0 3px rgba(11, 163, 96, 0.2);
}

.hex-app .hex-textarea.error {
    border-color: #e53e3e;
    background-color: #fff5f5;
}

.hex-app .hex-error-msg {
    font-size: 0.8rem;
    color: #e53e3e;
    margin-top: 4px;
    display: none;
    font-weight: 500;
}

.hex-app .hex-error-msg.show {
    display: block;
}

/* Toolbar Actions */
.hex-app .hex-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hex-app .hex-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hex-app .hex-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hex-app .hex-btn-primary {
    background: linear-gradient(135deg, #0ba360 0%, #3cba92 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(11, 163, 96, 0.3);
}

.hex-app .hex-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(11, 163, 96, 0.4);
}

.hex-app .hex-btn-secondary {
    background: #edf2f7;
    color: #4a5568;
}

.hex-app .hex-btn-secondary:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.hex-app .hex-btn-outline {
    background: transparent;
    border: 1px solid #cbd5e0;
    color: #4a5568;
}

.hex-app .hex-btn-outline:hover {
    background: #f7fafc;
    border-color: #a0aec0;
}

/* Related Tools Card */
.hex-app .hex-related-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf2f7;
}

.hex-app .hex-related-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hex-app .hex-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.hex-app .hex-related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.hex-app .hex-related-item:hover {
    border-color: #0ba360;
    color: #0ba360;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(11, 163, 96, 0.1);
}

/* Toast notification */
.hex-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2d3748;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 9999;
}

.hex-toast.show {
    opacity: 1;
    transform: translateY(0);
}
