/* Scoped styles for the Word Counter App */

:root {
    --wc-bg: rgba(17, 24, 39, 0.7);
    --wc-primary: #a855f7;
    --wc-primary-hover: #9333ea;
    --wc-border: rgba(255, 255, 255, 0.1);
}

.app-container {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.main-card {
    background: var(--wc-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--wc-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    width: 100%;
    max-width: 1050px;
    overflow: hidden;
    min-height: 560px;
    margin-top: 2rem;
}

/* Common Section Styles */
.input-section,
.display-section {
    padding: 2.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Left Section */
.input-section {
    border-right: 1px solid var(--wc-border);
}

.brand {
    margin-bottom: 1.25rem;
}

.brand h1 {
    font-size: 2.2rem;
    font-weight: 600;
    background: linear-gradient(to right, #c084fc, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.brand p {
    color: #94a3b8;
    font-size: 1rem;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.toolbar-btn {
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--wc-border);
    background: rgba(15, 23, 42, 0.6);
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    border-color: var(--wc-primary);
    color: var(--wc-primary);
}

/* Text Input */
#text-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--wc-border);
    border-radius: 12px;
    padding: 1rem;
    color: #f8fafc;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.95rem;
    outline: none;
    resize: none;
    line-height: 1.8;
    transition: border-color 0.3s ease;
    min-height: 250px;
}

#text-input:focus {
    border-color: var(--wc-primary);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.15);
}

#text-input::placeholder {
    color: #475569;
}

/* Right Section */
.display-section {
    background: rgba(15, 23, 42, 0.3);
    overflow-y: auto;
    justify-content: flex-start;
}

.result-header {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.result-header label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--wc-border);
    border-radius: 12px;
    padding: 1rem 0.75rem;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Reading Time */
.reading-time-section {
    margin-bottom: 1.5rem;
}

.reading-time-header {
    margin-bottom: 0.6rem;
}

.reading-time-header label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reading-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.reading-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--wc-border);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
}

.reading-item i {
    color: var(--wc-primary);
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.reading-item span:first-of-type {
    flex: 1;
}

.reading-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Top Keywords */
.top-words-section {
    flex: 1;
}

.top-words-header {
    margin-bottom: 0.6rem;
}

.top-words-header label {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.top-words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.empty-msg {
    color: #475569;
    font-size: 0.85rem;
    font-style: italic;
}

.keyword-chip {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.8rem;
    color: #c4b5fd;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.keyword-count {
    background: rgba(168, 85, 247, 0.2);
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--wc-primary);
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .main-card {
        flex-direction: column;
        height: auto;
    }

    .input-section {
        border-right: none;
        border-bottom: 1px solid var(--wc-border);
        padding: 2rem;
    }

    .display-section {
        padding: 2rem;
        min-height: 400px;
    }

    .brand h1 {
        font-size: 1.8rem;
    }

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