/* ===========================
   문자수·단어수 계산기 스타일
   =========================== */

/* 페이지 컨테이너 가운데 정렬 */
.page-container {
    padding: 20px;
}

.page-container .container {
    max-width: 1200px;
    margin: 0 auto;
    display: block;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
}

/* 래퍼 */
.counter-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* 페이지 헤더 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.header-text p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* 메인 콘텐츠 */
.counter-main {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 입력 영역 */
.input-area {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.input-header h2 {
    font-size: 1.1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-header h2 i {
    color: var(--primary-color);
}

.input-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.textarea-container textarea {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.8;
    resize: vertical;
    transition: var(--transition);
}

.textarea-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.textarea-container textarea::placeholder {
    color: var(--text-muted);
}

/* 통계 영역 */
.stats-area {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
}

.stats-area h2 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-area h2 i {
    color: var(--primary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card.primary {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.stat-card.primary .stat-icon {
    background: var(--primary-color);
    color: white;
}

.stat-card.success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.stat-card.success .stat-icon {
    background: var(--success-color);
    color: white;
}

.stat-card.info {
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
}

.stat-card.info .stat-icon {
    background: var(--info-color);
    color: white;
}

.stat-card.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.stat-card.warning .stat-icon {
    background: var(--warning-color);
    color: white;
}

.stat-card.secondary {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.stat-card.secondary .stat-icon {
    background: var(--secondary-color);
    color: white;
}

.stat-card.light {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.stat-card.light .stat-icon {
    background: #94a3b8;
    color: white;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* 상세 분석 영역 */
.detail-area {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
}

.detail-area h2 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-area h2 i {
    color: var(--primary-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.detail-card {
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.detail-card h3 {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.detail-card h3 i {
    color: var(--primary-color);
}

.detail-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.detail-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

/* 옵션 영역 */
.options-area {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
}

.options-area h2 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.options-area h2 i {
    color: var(--primary-color);
}

.options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-color);
    user-select: none;
}

.option-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.option-item input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.option-item input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.option-item:hover .checkmark {
    border-color: var(--primary-color);
}

/* 토스트 알림 */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 15px 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast i {
    font-size: 1.1rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===========================
   반응형 스타일
   =========================== */

/* 태블릿 */
@media (max-width: 992px) {
    .counter-wrapper {
        padding: 0 15px 30px;
    }
    
    .page-header {
        padding: 30px;
    }
    
    .header-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .header-text h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 모바일 */
@media (max-width: 768px) {
    .page-header {
        padding: 25px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-icon {
        width: 70px;
        height: 70px;
    }
    
    .header-text h1 {
        font-size: 1.4rem;
    }
    
    .header-text p {
        font-size: 0.95rem;
    }
    
    .input-area,
    .stats-area,
    .detail-area,
    .options-area {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        flex-direction: column;
        gap: 15px;
    }
    
    .toast-container {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }
    
    .toast {
        padding: 12px 20px;
    }
}

/* 작은 모바일 */
@media (max-width: 480px) {
    .counter-wrapper {
        padding: 0 10px 20px;
    }
    
    .page-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .header-text h1 {
        font-size: 1.2rem;
    }
    
    .input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .textarea-container textarea {
        min-height: 150px;
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: row;
        text-align: left;
    }
}

/* ===== FAQ/QNA 섹션 (페이지 하단) ===== */
.faq-section {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    padding: 40px 32px;
    margin: 40px auto 0 auto;
    max-width: 900px;
}

.faq-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    text-align: center;
}

.faq-title i {
    color: #2563eb;
    font-size: 1.5rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    transition: all 0.3s ease;
    width: 100%;
}

.faq-item.active,
.faq-item:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    background: #f8fafc;
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    line-height: 1.6;
    width: 100%;
}

.faq-question span:not(.faq-icon) {
    flex: 1;
    word-break: keep-all;
}

.faq-icon {
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.faq-arrow {
    margin-left: auto;
    color: #64748b;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
    color: #2563eb;
}

.faq-item .faq-answer {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid #e2e8f0;
    color: #475569;
    font-size: 1rem;
    line-height: 1.8;
    width: 100%;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-answer p {
    margin: 0;
    margin-bottom: 8px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer strong {
    color: #1e293b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .faq-section {
        padding: 24px 20px;
        margin: 24px 0 0;
    }
    
    .faq-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
        flex-direction: column;
        gap: 8px;
    }
    
    .faq-item {
        padding: 16px 18px;
    }
    
    .faq-question {
        font-size: 1rem;
        gap: 10px;
    }
    
    .faq-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .faq-item .faq-answer {
        font-size: 0.95rem;
    }
}
