/* General Plugin Styles */
#tccn-plugin-container {
    font-family: 'Inter', sans-serif;
    color: #334155; /* slate-700 */
}

.tccn-header {
    margin-bottom: 2rem;
}

.tccn-logo-wrap {
    margin-bottom: 1rem;
}

.tccn-title {
    font-weight: 700;
    color: #1e293b; /* slate-800 */
}

.tccn-subtitle {
    color: #475569; /* slate-600 */
    margin-top: 0.5rem;
}

/* Card Style */
.tccn-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    padding: 1.5rem;
}

.tccn-mb-8 {
    margin-bottom: 2rem;
}

/* Search Bar */
.tccn-search-bar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .tccn-search-bar {
        flex-direction: row;
    }
}

#tccn-char-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #cbd5e1; /* slate-300 */
    border-radius: 0.5rem;
    transition: all 0.2s;
}

#tccn-char-input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #6366f1; /* indigo-500 */
    box-shadow: 0 0 0 2px #a5b4fc; /* indigo-300 */
}

/* Buttons */
.tccn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s;
    gap: 0.5rem;
}

.tccn-btn-primary {
    background-color: #4f46e5; /* indigo-600 */
    color: white;
    width: 100%;
}
@media (min-width: 640px) {
    .tccn-btn-primary {
        width: auto;
    }
}

.tccn-btn-primary:hover {
    background-color: #4338ca; /* indigo-700 */
}

.tccn-btn-secondary {
    background-color: #e2e8f0; /* slate-200 */
    color: #475569; /* slate-600 */
}

.tccn-btn-secondary:hover {
    background-color: #cbd5e1; /* slate-300 */
}

/* Suggestion List */
#tccn-suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tccn-char-suggestion-btn {
    font-size: 2rem;
    padding: 0.5rem 1rem;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    color: #1e293b; /* slate-800 */
}

.tccn-char-suggestion-btn:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

/* Main Layout Grid */
.tccn-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .tccn-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.tccn-left-col, .tccn-right-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Writing & Practice Area */
#tccn-character-target, #tccn-practice-target {
    width: 100%;
    height: 250px;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

#tccn-practice-target {
    height: 300px;
}

.tccn-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* Details Section */
.tccn-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #334155; /* slate-700 */
    margin-bottom: 1rem;
}

.tccn-char-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5; /* indigo-600 */
    margin-bottom: 0.25rem;
}

.tccn-han-viet-container {
    font-size: 1.125rem;
    color: #475569; /* slate-600 */
    margin-bottom: 1.5rem;
}
.tccn-han-viet-container .tccn-label {
    font-weight: 600;
}

.tccn-details-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tccn-details-heading {
    font-size: 1.125rem;
    font-weight: 600;
    color: #334155; /* slate-700 */
    border-bottom: 1px solid #e2e8f0; /* slate-200 */
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.tccn-meanings p {
    margin: 0;
}
.tccn-meaning-number {
    font-weight: 700;
}
.tccn-pos {
    font-style: italic;
    color: #64748b; /* slate-500 */
}

.clickable-char {
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 500;
    color: #4f46e5; /* indigo-600 */
}

.clickable-char:hover {
    background-color: #e0e7ff; /* indigo-100 */
    color: #4338ca; /* indigo-700 */
}

.han-viet-reading {
    color: #166534; /* green-800 */
    font-style: italic;
    margin-left: 0.25rem;
}

/* Related Words */
.tccn-related-words {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tccn-related-word {
    background-color: #e0e7ff; /* indigo-100 */
    color: #3730a3; /* indigo-800 */
    font-size: 1rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Examples */
.tccn-examples {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.tccn-example {
    border-left: 4px solid #e2e8f0; /* slate-200 */
    padding-left: 1rem;
}
.tccn-example-zh {
    font-size: 1.25rem;
}
.tccn-example-reading {
    font-size: 0.875rem;
    color: #64748b; /* slate-500 */
}
.tccn-example-vi {
    font-size: 1rem;
    color: #334155; /* slate-700 */
    font-style: italic;
}

/* Loader & Messages */
.tccn-loader, .tccn-loader-initial {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.tccn-hidden {
    display: none !important;
}

.tccn-initial-message {
    text-align: center;
    color: #64748b; /* slate-500 */
    padding: 2.5rem 0;
}

.tccn-error-msg {
    color: #dc2626; /* red-600 */
}

/* Footer & QR */
.tccn-qr-wrap {
    text-align: center;
    margin-top: 3rem;
}
.tccn-qr-wrap p {
    color: #475569; /* slate-600 */
}
.tccn-qr-wrap img {
    width: 150px;
    height: 150px;
    margin: 1rem auto 0;
    display: block;
}

.tccn-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0; /* slate-200 */
}
