/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --primary-light: #5dade2;
    --secondary-color: #2c3e50;
    --secondary-dark: #1a252f;
    --accent-color: #2ecc71;
    --accent-dark: #27ae60;
    --danger-color: #e74c3c;
    --danger-dark: #c0392b;
    --warning-color: #f39c12;
    --warning-dark: #e67e22;
    --purple-color: #9b59b6;
    --purple-dark: #8e44ad;
    --light-bg: #f8fafc;
    --light-card: #ffffff;
    --light-border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 35px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: linear-gradient(135deg, 
        rgba(52, 152, 219, 0.08) 0%, 
        rgba(46, 204, 113, 0.05) 50%, 
        rgba(155, 89, 182, 0.03) 100%);
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header mới - Thiết kế chuyên nghiệp */
.header {
    background: var(--light-card);
    border-radius: var(--radius-xl);
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--light-border);
    overflow: hidden;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--primary-color) 0%, 
        var(--accent-color) 50%, 
        var(--purple-color) 100%);
    z-index: 1;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 35px;
    position: relative;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.25);
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    transform: rotate(45deg);
    animation: shine 3s infinite linear;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.logo-icon i {
    font-size: 1.8rem;
    color: white;
    z-index: 1;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

h1 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin: 0;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.home-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.home-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent-color));
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.home-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.35);
    border-color: rgba(255, 255, 255, 0.3);
}

.home-link:hover::before {
    opacity: 1;
}

.home-link:active {
    transform: translateY(-1px);
}

.home-link i {
    font-size: 1.1rem;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.header-badge i {
    font-size: 1rem;
}

.header-subtitle {
    background: linear-gradient(90deg, 
        rgba(52, 152, 219, 0.05) 0%, 
        rgba(46, 204, 113, 0.05) 100%);
    padding: 18px 35px;
    border-top: 1px solid var(--light-border);
}

.subtitle-content {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.subtitle-content i {
    color: var(--accent-color);
    font-size: 1.1rem;
}

/* Main Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: var(--light-card);
    border-radius: var(--radius-xl);
    padding: 30px 25px;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.3);
}

.stat-icon i {
    font-size: 2rem;
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Text Area */
.text-area-container {
    background: var(--light-card);
    border-radius: var(--radius-xl);
    padding: 30px;
    margin-bottom: 35px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--light-border);
    position: relative;
}

.text-area-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        rgba(52, 152, 219, 0.1) 0%, 
        rgba(46, 204, 113, 0.1) 100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.textarea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.textarea-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Poppins', 'Inter', sans-serif;
}

.textarea-header h3 i {
    color: var(--primary-color);
    font-size: 1.6rem;
}

.textarea-actions {
    display: flex;
    gap: 15px;
}

.btn-clear {
    background: linear-gradient(135deg, var(--danger-color), var(--danger-dark));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    font-family: 'Inter', sans-serif;
}

.btn-clear:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
}

.btn-sample {
    background: linear-gradient(135deg, var(--warning-color), var(--warning-dark));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
    font-family: 'Inter', sans-serif;
}

.btn-sample:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.4);
}

textarea {
    width: 100%;
    min-height: 220px;
    padding: 25px;
    border: 2px solid var(--light-border);
    border-radius: var(--radius-lg);
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-primary);
    resize: vertical;
    transition: var(--transition);
    background: var(--light-bg);
    outline: none;
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
    background: var(--light-card);
}

textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.textarea-footer {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

#charProgress {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    min-width: 140px;
    font-family: 'Inter', sans-serif;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: var(--light-border);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Bottom Container */
.bottom-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.info-card {
    background: var(--light-card);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    transition: var(--transition);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        rgba(52, 152, 219, 0.1) 0%, 
        rgba(46, 204, 113, 0.1) 100%);
    opacity: 0;
    transition: var(--transition);
}

.info-card:hover::before {
    opacity: 1;
}

.info-card:hover {
    border-color: var(--light-border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.info-card h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 1.3rem;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(52, 152, 219, 0.1);
    font-family: 'Poppins', 'Inter', sans-serif;
}

.info-card h3 i {
    color: var(--primary-color);
    font-size: 1.4rem;
}

/* Character Details */
.detail-grid {
    display: grid;
    gap: 18px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.detail-item:hover {
    background: linear-gradient(90deg, var(--light-bg), rgba(52, 152, 219, 0.05));
    transform: translateX(5px);
    border-left-color: var(--primary-color);
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
}

.detail-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    background-color: rgba(52, 152, 219, 0.1);
}

/* Keywords */
.keywords-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.multiplier-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--light-bg);
    padding: 10px 15px;
    border-radius: var(--radius-md);
}

.multiplier-control label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

#keywordMultiplier {
    padding: 10px 16px;
    border: 2px solid var(--light-border);
    border-radius: var(--radius-md);
    background: var(--light-card);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
    outline: none;
    font-family: 'Inter', sans-serif;
}

#keywordMultiplier:hover,
#keywordMultiplier:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.keywords-list {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--light-bg);
}

.keywords-list::-webkit-scrollbar {
    width: 8px;
}

.keywords-list::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 4px;
}

.keywords-list::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary-color), var(--primary-dark));
    border-radius: 4px;
}

.keywords-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--primary-dark), var(--secondary-color));
}

.keyword-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 18px;
    padding: 16px 20px;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: var(--transition);
    align-items: center;
}

.keyword-item:hover {
    background: linear-gradient(90deg, var(--light-bg), rgba(52, 152, 219, 0.05));
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.keyword-text {
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
    font-size: 1rem;
}

.keyword-count {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--danger-color);
    padding: 4px 8px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: var(--radius-sm);
}

.keyword-percent {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 4px 8px;
    background: rgba(127, 140, 141, 0.1);
    border-radius: var(--radius-sm);
}

.empty-state {
    text-align: center;
    padding: 50px 30px;
    color: var(--text-muted);
    background: var(--light-bg);
    border-radius: var(--radius-md);
    border: 2px dashed var(--light-border);
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--light-border);
    opacity: 0.7;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.empty-state small {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Time Analysis */
.time-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 30px;
}

.time-item {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 25px;
    border-radius: var(--radius-lg);
    background: var(--light-bg);
    transition: var(--transition);
    border: 2px solid transparent;
}

.time-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(52, 152, 219, 0.2);
}

.time-item.reading {
    border-left: 6px solid var(--primary-color);
}

.time-item.speaking {
    border-left: 6px solid var(--accent-color);
}

.time-icon {
    width: 60px;
    height: 60px;
    background: var(--light-card);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.time-item.reading .time-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.3);
}

.time-item.speaking .time-icon {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.3);
}

.time-icon i {
    font-size: 1.8rem;
    color: white;
}

.time-content {
    flex: 1;
}

.time-label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 5px;
}

.time-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.word-density {
    background: var(--light-bg);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(52, 152, 219, 0.1);
}

.density-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

.density-item span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
}

.density-value {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Footer */
.footer {
    margin-top: 50px;
}

.ad-container {
    background: var(--light-card);
    border-radius: var(--radius-xl);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--light-border);
    overflow: hidden;
}

.footer-info {
    background: var(--light-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--light-border);
    text-align: center;
}

.footer-brand {
    margin-bottom: 30px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.25);
}

.footer-logo i {
    font-size: 1.3rem;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    padding: 25px 0;
    border-top: 2px solid var(--light-border);
    border-bottom: 2px solid var(--light-border);
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    background: var(--light-bg);
}

.footer-links a:hover {
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.footer-links a i {
    font-size: 1.1rem;
}

.copyright {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--light-border);
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bottom-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bottom-container > :last-child {
        grid-column: span 2;
    }
}

@media (max-width: 992px) {
    h1 {
        font-size: 1.9rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .header-container {
        padding: 20px 25px;
    }
    
    .logo-icon {
        width: 50px;
        height: 50px;
    }
    
    .logo-icon i {
        font-size: 1.6rem;
    }
    
    .home-link span {
        display: none;
    }
    
    .home-link {
        padding: 12px;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-badge span {
        display: none;
    }
    
    .header-badge {
        padding: 12px;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-subtitle {
        padding: 15px 25px;
    }
    
    .subtitle-content {
        font-size: 0.95rem;
        justify-content: flex-start;
    }
    
    .textarea-header {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .textarea-actions {
        justify-content: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header {
        border-radius: var(--radius-lg);
    }
    
    .header-container {
        flex-direction: column;
        gap: 20px;
        padding: 25px 20px;
        text-align: center;
    }
    
    .brand-logo {
        justify-content: center;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
        gap: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .logo-icon {
        width: 45px;
        height: 45px;
    }
    
    .logo-icon i {
        font-size: 1.5rem;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .bottom-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .bottom-container > :last-child {
        grid-column: span 1;
    }
    
    .stat-card {
        padding: 25px 20px;
    }
    
    .stat-value {
        font-size: 2.4rem;
    }
    
    .info-card {
        padding: 25px;
    }
    
    .keywords-header {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .multiplier-control {
        justify-content: space-between;
    }
    
    .keyword-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }
    
    .keyword-count,
    .keyword-percent {
        text-align: center;
        display: inline-block;
        width: auto;
        padding: 8px 16px;
    }
    
    .time-item {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 20px;
    }
    
    .time-icon {
        width: 70px;
        height: 70px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-links a {
        justify-content: center;
        padding: 12px;
    }
    
    .footer-info {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem;
    }
    
    .tagline {
        font-size: 0.95rem;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    .logo-icon i {
        font-size: 1.4rem;
    }
    
    .home-link,
    .header-badge {
        width: 44px;
        height: 44px;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
    }
    
    .stat-icon i {
        font-size: 1.6rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .textarea-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-clear,
    .btn-sample {
        width: 100%;
        justify-content: center;
    }
    
    .text-area-container {
        padding: 20px;
    }
    
    textarea {
        padding: 20px;
        font-size: 1rem;
    }
    
    .textarea-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    #charProgress {
        text-align: center;
    }
    
    .footer-logo {
        font-size: 1.1rem;
        padding: 10px 20px;
    }
}

/* Animation for loading */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.header {
    animation: fadeIn 0.6s ease-out;
}

.stat-card,
.info-card,
.text-area-container {
    animation: fadeIn 0.5s ease-out forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.info-card:nth-child(1) { animation-delay: 0.2s; }
.info-card:nth-child(2) { animation-delay: 0.3s; }
.info-card:nth-child(3) { animation-delay: 0.4s; }
.text-area-container { animation-delay: 0.1s; }

/* Hiệu ứng hover cho nút */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.home-link:hover i {
    animation: pulse 0.6s ease infinite;
}