/* 키워드 카드 기본 스타일 */
.keyword-card {
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px;
    min-height: 140px;
}

.keyword-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* 카드 크기별 스타일 */
.card-large {
    min-height: 180px;
    padding: 24px;
}

.card-medium {
    min-height: 160px;
    padding: 20px;
}

.card-small {
    min-height: 140px;
    padding: 16px;
}

.card-mini {
    min-height: 120px;
    padding: 12px;
}

/* 카테고리별 색상 */
.card-marketing { border-left: 4px solid #FF6B6B; }
.card-seo { border-left: 4px solid #4ECDC4; }
.card-content { border-left: 4px solid #45B7D1; }
.card-social { border-left: 4px solid #96CEB4; }
.card-analytics { border-left: 4px solid #FFEAA7; }
.card-default { border-left: 4px solid #9CA3AF; }

/* 경쟁도별 배경색 */
.competition-low { background: linear-gradient(135deg, #E8F5E8, #F0FFF0); }
.competition-medium { background: linear-gradient(135deg, #FFF8E1, #FFFEF7); }
.competition-high { background: linear-gradient(135deg, #FFEBEE, #FFF5F5); }

/* 트렌드 아이콘 색상 */
.trend-up { color: #4CAF50; }
.trend-down { color: #F44336; }
.trend-stable { color: #FF9800; }

/* 카드 헤더 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.keyword-title {
    font-weight: 600;
    color: #1F2937;
    margin: 0;
    line-height: 1.3;
    font-size: 16px;
}

.keyword-title.large { font-size: 18px; }
.keyword-title.medium { font-size: 17px; }
.keyword-title.small { font-size: 16px; }
.keyword-title.mini { font-size: 14px; }

.trend-indicator {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

/* 지표 섹션 */
.card-metrics {
    margin-bottom: 12px;
    flex-grow: 1;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.metric-label {
    font-size: 11px;
    color: #6B7280;
    font-weight: 500;
}

.metric-value {
    font-weight: 600;
    color: #374151;
    font-size: 12px;
}

.metric-value.primary {
    color: #2563EB;
    font-size: 14px;
}

/* 별점 표시 */
.competition-stars {
    display: flex;
    gap: 2px;
}

.star-filled {
    color: #FFC107;
    fill: currentColor;
    width: 12px;
    height: 12px;
}

.star-empty {
    color: #E5E7EB;
    width: 12px;
    height: 12px;
}

/* 카테고리 태그 */
.category-tag {
    display: inline-block;
    background: #F3F4F6;
    color: #6B7280;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: capitalize;
    margin-bottom: 12px;
}

/* 액션 버튼 */
.card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
}

.action-btn.primary {
    background: #2563EB;
    color: white;
}

.action-btn.primary:hover {
    background: #1D4ED8;
}

.action-btn.secondary {
    background: #F3F4F6;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.action-btn.secondary:hover {
    background: #E5E7EB;
    color: #374151;
}

/* 그리드 레이아웃 */
.keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px 0;
}

/* 필터 컨트롤 */
.keyword-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.filter-label {
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
}

.filter-select, .filter-input {
    padding: 6px 8px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 13px;
    background: white;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 섹션 헤더 */
.section-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 4px 0;
}

.section-subtitle {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

/* 반응형 조정 */
@media (min-width: 640px) {
    .keywords-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .keyword-filters {
        flex-wrap: nowrap;
    }
}

@media (min-width: 1024px) {
    .keywords-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 24px;
    }
}

/* 애니메이션 */
.keyword-card {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 빈 상태 스타일 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6B7280;
}

.empty-state button {
    margin-top: 16px;
    padding: 8px 16px;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.empty-state button:hover {
    background: #1D4ED8;
}

/* 아이콘 크기 조정 */
.lucide-icon {
    width: 14px;
    height: 14px;
}

.lucide-icon-small {
    width: 12px;
    height: 12px;
}

/* 메인 탭 스타일 */
.main-tab-content {
    display: block !important;
}

.main-tab-content.hidden {
    display: none !important;
}

/* Tailwind hidden 클래스 오버라이드 */
.main-tab-content.hidden {
    display: none !important;
}

.main-tab-content:not(.hidden) {
    display: block !important;
}

/* 네비게이션 활성 상태 */
.nav-btn.active {
    color: #2563EB !important;
    background-color: #EFF6FF;
    border-radius: 6px;
}

/* 개선된 분석 결과 스타일 */
.analysis-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

.main-analysis {
    background: white;
    border-radius: 16px;
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

.keyword-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    text-align: center;
}

.keyword-title-main {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.keyword-category {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: #E5E7EB;
}

.metric-card {
    background: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.metric-label-main {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value-main {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
    margin: 0;
}

.metric-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.metric-card.highlight .metric-label-main {
    color: rgba(255, 255, 255, 0.8);
}

.metric-card.highlight .metric-value-main {
    color: white;
}

.chart-section {
    padding: 24px;
    border-top: 1px solid #E5E7EB;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 16px 0;
}

.trend-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
}

.trend-stat {
    text-align: center;
}

.trend-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #10B981;
    margin: 0;
}

.trend-stat-label {
    font-size: 12px;
    color: #6B7280;
    margin: 4px 0 0 0;
}

.sidebar-analysis {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.related-keywords-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

.panel-header {
    background: #F9FAFB;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-content {
    padding: 16px;
}

.related-keyword-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    transition: all 0.2s;
}

.related-keyword-item:hover {
    background: #EFF6FF;
    border-color: #3B82F6;
}

.keyword-info {
    flex: 1;
}

.keyword-text {
    font-size: 14px;
    font-weight: 500;
    color: #1F2937;
    margin: 0 0 4px 0;
}

.keyword-volume {
    font-size: 12px;
    color: #6B7280;
    margin: 0;
}

.keyword-competition {
    display: flex;
    align-items: center;
    gap: 4px;
}

.competition-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.competition-dot.low { background: #10B981; }
.competition-dot.medium { background: #F59E0B; }
.competition-dot.high { background: #EF4444; }

.suggestions-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
}

.suggestion-item {
    padding: 12px 16px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:before {
    content: "💡 ";
    margin-right: 8px;
}

.questions-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
}

.question-item {
    padding: 12px 16px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

.question-item:last-child {
    border-bottom: none;
}

.question-item:before {
    content: "❓ ";
    margin-right: 8px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .analysis-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .keyword-title-main {
        font-size: 24px;
    }
    
    .metric-value-main {
        font-size: 20px;
    }
}

/* 로딩 애니메이션 */
.loading-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}