/* JSON TOON Converter Custom Styles */

/* 전체 레이아웃 간격 개선 */
.p-4 {
    padding: 1.5rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-3 {
    margin-bottom: 1.25rem !important;
}

.mb-2 {
    margin-bottom: 0.75rem !important;
}

.mt-3 {
    margin-top: 1.25rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

/* Row 간격 강제 적용 */
.row.g-3 > * {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.row.g-3 {
    margin-left: -0.75rem !important;
    margin-right: -0.75rem !important;
    margin-bottom: 0 !important;
}

/* 버튼 간격 */
.d-flex.gap-2 {
    gap: 0.5rem !important;
}

/* 토큰 카운터 */
.token-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--bs-primary);
    pointer-events: none;
}

.dark-mode .token-counter {
    background: rgba(var(--bs-primary-rgb), 0.2);
}

/* 정보 카드 */
.info-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark-mode .info-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.info-icon {
    font-size: 2rem;
    color: var(--bs-primary);
    margin-bottom: 0.75rem;
}

.info-card h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--bs-body-color);
}

/* 버튼 그룹 개선 */
.btn-group .btn-check:checked + label {
    background-color: var(--bs-primary);
    color: white;
}

/* 텍스트 영역 개선 */
#inputText,
#outputText {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 1rem;
    padding-bottom: 45px; /* 토큰 카운터 공간 확보 */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    resize: vertical;
}

#inputText:focus,
#outputText:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

#outputText {
    background: var(--bs-secondary-bg);
}

:root[data-bs-theme="light"] #outputText {
    background: #faf8f5;
    border-color: #d8d4cb;
}

:root[data-bs-theme="dark"] #outputText {
    background: #0a0a0a;
    border-color: #2f3336;
}

/* Alert 스타일 개선 */
#savingsAlert {
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, rgba(var(--bs-info-rgb), 0.1) 0%, rgba(var(--bs-success-rgb), 0.1) 100%);
    border-left: 4px solid var(--bs-success);
}

/* Card 스타일 */
.card {
    border-radius: 12px;
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dark-mode .card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 버튼 호버 효과 */
.btn-outline-secondary:hover,
.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 폼 라벨 */
.form-label {
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
}

/* 체크박스 개선 */
.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Select 드롭다운 */
.form-select {
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
}

.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* 반응형 조정 */
@media (max-width: 768px) {
    .info-card {
        margin-bottom: 1rem;
    }
    
    #inputText,
    #outputText {
        font-size: 0.85rem;
    }
    
    .token-counter {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}

/* 애니메이션 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-card {
    animation: slideIn 0.4s ease-out;
}

.info-card:nth-child(1) {
    animation-delay: 0.1s;
}

.info-card:nth-child(2) {
    animation-delay: 0.2s;
}

.info-card:nth-child(3) {
    animation-delay: 0.3s;
}
