/* AI Agent Platform - 통합 스타일 시스템 */
/* Tailwind CSS 확장 + 공통 컴포넌트 스타일 */

/* =============================================================================
   전역 설정 및 기본 스타일
   ============================================================================= */

/* 전문적인 폰트 스택 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
}

/* =============================================================================
   공통 헤더 스타일
   ============================================================================= */

.header-gradient {
    background: linear-gradient(90deg, #495057 0%, #343a40 100%);
}

.header-logo {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================================================
   공통 상태 표시 스타일
   ============================================================================= */

/* 상태 점 */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-active { background: #22c55e; }
.status-draft { background: #6b7280; }
.status-running { 
    background: #3b82f6; 
    animation: pulse 2s infinite;
}
.status-paused { background: #f59e0b; }
.status-error { background: #ef4444; }

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

/* 연결 상태 */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

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

.connection-connected { background: #22c55e; }
.connection-disconnected { background: #ef4444; }
.connection-error { background: #f59e0b; }

/* =============================================================================
   공통 폼 요소 스타일
   ============================================================================= */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input:invalid {
    border-color: #ef4444;
}

.form-input:disabled {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 에러 상태 */
.form-error .form-input,
.form-error .form-select {
    border-color: #ef4444;
}

.form-error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* =============================================================================
   공통 카드 및 패널 스타일
   ============================================================================= */

.panel {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.panel-body {
    padding: 1.5rem;
}

.panel-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* 통계 카드 */
.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

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

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
    display: block;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* =============================================================================
   공통 버튼 스타일 (Tailwind 확장)
   ============================================================================= */

/* 베타 배지 애니메이션 */
@keyframes pulse-scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.beta-badge {
    animation: pulse-scale 2s infinite;
}

/* 그라디언트 배경 */
.bg-beta-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-beta-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 메시지 대화 스타일 */
.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 16px 0;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    margin: 0;
}

.user-message .message-content {
    margin-left: auto;
    margin-right: 0;
    max-width: 80%;
}

.ai-message .message-content {
    margin-left: 0;
    margin-right: auto;
    max-width: 85%;
}

/* 상태 표시 */
.status-indicator {
    font-family: 'Courier New', monospace;
    font-style: italic;
}

/* 호버 효과 강화 */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 체크박스 카드 선택 상태 */
.interest-card input[type="checkbox"]:checked + .card-content {
    border-color: #3b82f6;
    background-color: #dbeafe;
}

.interest-card input[type="checkbox"]:checked + .card-content .icon-bg {
    background-color: #3b82f6;
    color: white;
}

/* 스크롤바 커스터마이징 */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* 반응형 그리드 개선 */
@media (max-width: 640px) {
    .message {
        flex-direction: column;
        align-items: center;
    }
    
    .message-avatar {
        margin-bottom: 8px;
    }
    
    .user-message .message-content,
    .ai-message .message-content {
        max-width: 100%;
        margin: 0;
    }
}

/* 포커스 스타일 개선 */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* 로딩 스켈레톤 */
.skeleton {
    background: #d1d5db;
    border-radius: 0.375rem;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-text {
    height: 1rem;
    background: #d1d5db;
    border-radius: 0.375rem;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 성공/에러 메시지 스타일 */
.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 1rem;
    border-radius: 0.5rem;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.5rem;
}

/* 공통 버튼 베이스 스타일 */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 버튼 변형 */
.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: #4b5563;
    border-color: #4b5563;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #374151;
    border-color: #374151;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(75, 85, 99, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
    color: inherit;
}

.btn-outline:hover:not(:disabled) {
    background: currentColor;
    color: white;
}

.btn-success {
    background: #059669;
    border-color: #059669;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #047857;
    border-color: #047857;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.3);
}

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
}

/* 버튼 크기 변형 */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* 카드 스타일 */
.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

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

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* 뱃지 스타일 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* 페이지별 특화 스타일 */

/* 베타 랜딩 페이지 */
.landing-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.landing-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.beta-counter {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 1rem;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 0.5rem;
}

/* 온보딩 페이지 */
.onboarding-container {
    max-width: 64rem;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
}

.progress-step {
    padding: 0.75rem 1.5rem;
    margin: 0 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.progress-step.completed {
    background: #22c55e;
    color: white;
}

.progress-step.active {
    background: #3b82f6;
    color: white;
}

.progress-step.pending {
    background: #e5e7eb;
    color: #6b7280;
}

.interest-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (min-width: 768px) {
    .interest-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .interest-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.interest-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.interest-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.interest-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.875rem;
    margin: 0 auto 1rem;
    transition: all 0.3s ease;
}

/* 데모 섹션 */
.demo-conversation {
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.conversation-flow {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.scenario-header {
    background: linear-gradient(to right, #eff6ff, #eef2ff);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #c7d2fe;
}

.test-result-card {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin-top: 0.75rem;
}

.token-usage {
    background: #f9fafb;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    border: 1px solid #e5e7eb;
}

.final-result {
    background: linear-gradient(to right, #fdf4ff, #fef7f7);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e9d5ff;
}

.agent-summary {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

/* 유틸리티 클래스 */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes bounce-gentle {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce-gentle {
    animation: bounce-gentle 2s infinite;
}

/* 리스폰시브 유틸리티 */
.container-responsive {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container-responsive {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container-responsive {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container-responsive {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container-responsive {
        max-width: 1280px;
    }
}