:root {
  /* Colors */
  --primary: #3C8D99;
  --primary-dark: #2563eb;
  --secondary: #6FCCB4;
  --accent: #FFB347;

  /* Grays */
    --gray-100: #F9FAFB;
    --gray-200: #e5e7eb;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    
  /* Text colors */
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-light: #F9FAFB;


  /* Background colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f3f4f6;
  --bg-hover: #f3f4f6;

     /* Spacing */
     --spacing-xs: 0.25rem;
     --spacing-sm: 0.5rem;
     --spacing-md: 0.75rem;
     --spacing-lg: 1rem;
     --spacing-xl: 1.5rem;
     --spacing: 1rem;
     
     /* Border radius */
     --radius-sm: 0.25rem;
     --radius-md: 0.5rem;
     --radius-lg: 0.75rem;
     --radius-full: 9999px;
     
     /* Shadows */
     --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
     --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
     
     /* Font sizes */
     --text-xs: 0.75rem;
     --text-sm: 0.875rem;
     --text-base: 1rem;
     --text-lg: 1.125rem;
     --text-xl: 1.25rem;
     --text-2xl: 1.5rem;
          
  
    
     /* Colors */
    --common-primary: #3C8D99;
    --common-primary-dark: #2563eb;
    --common-secondary: #6FCCB4;
    --common-accent: #FFB347;

    /* Grays */
    --common-gray-100: #F9FAFB;
    --common-gray-200: #e5e7eb;
    --common-gray-600: #4b5563;
    --common-gray-700: #374151;
    --common-background: #F8FAFC;
    --common-surface: #FFFFFF;
    --common-border: #E5E7EB;
    
    /* Text colors */
    --common-text-primary: #1a1a1a;
    --common-text-secondary: #6b7280;
    --common-text-light: #F9FAFB;

    /* Background colors */
    --common-bg-primary: #ffffff;
    --common-bg-secondary: #f3f4f6;
    --common-bg-hover: #f3f4f6;
}

* {
    
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    background-color: #f5f5f5;
    
}

.header {
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    
}
/* top-bar와 search-bar만 고정하기 위한 수정 */
.header .top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    z-index: 1000;
    padding: 1rem 1rem 0rem 1rem;
    
}

.header .search-bar {
    position: fixed;
    top: 60px; /* top-bar 높이만큼 아래로 */
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    z-index: 1000;
    padding: var(--spacing-lg);
    transform: translateY(-100%); /* 처음에는 위로 숨김 */
    transition: transform 0.3s ease; /* 부드러운 전환 효과 */
}

.header .search-bar.active {
    transform: translateY(0); /* 활성화되면 원래 위치로 */
}

/* 프로필 섹션이 고정된 요소와 겹치지 않도록 */
.header .profile-section {
    margin-top: 50px; /* top-bar 높이만큼만 여백 */
}

.header-content {
    max-width: 48rem;
    margin: 0 auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: var(--text-2xl);
    font-weight: bold;
    color: var(--text-primary);
}

.actions {
    display: flex;
    gap: var(--spacing-md);
}

.icon-button {
    background: none;
    border: none;
    padding: var(--spacing-sm);
    border-radius: var(--radius-full);
    cursor: pointer;
    position: relative;
    color: var(--secondary);
}

.icon-button:hover {
    background-color: var(--bg-hover);
}

.notification-dot {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: var(--radius-full);
}

.search-bar {
    display: none;
    padding: 0.5rem 0;
}

.search-bar.active {
    display: block;
}

.search-input-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.search-input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: var(--text-sm);
}

.profile-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.avatar {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-weight: 500;
    color: var(--text-primary);
}

.profile-detail {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
/* --spacing-xs: 0.25rem;
     --spacing-sm: 0.5rem;
     : 0.75rem; */
     
.location-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    font-size: var(--text-sm);
    color: var(--secondary);
}



/* Tab Bar */
.tab-bar {
    background-color: var(--bg-primary);
    padding: var(--spacing-sm) 0;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
}

.tab-bar-content {
    max-width: 48rem;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-xs);
    gap: var(--spacing-xs);
    min-width: 60px;
}

.tab-item.active {
    color: var(--primary);
}

.tab-item svg {
    width: 24px;
    height: 24px;
}


/* Loading Indicator */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--gray-200);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}





.common-alert {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.common-alert.success .alert-icon {
    color: #2ecc71;
}

.common-alert.warning .alert-icon {
    color: #f39c12;
}

.common-alert.error .alert-icon {
    color: #e74c3c;
}

.common-alert.info .alert-icon {
    color: #3498db;
}

@keyframes alertFadeIn {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes alertFadeOut {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, -20px); }
}

.alert-enter {
    animation: alertFadeIn 0.3s forwards;
}

.alert-exit {
    animation: alertFadeOut 0.3s forwards;
}



.common-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: rgba(248, 250, 252, 0.9);
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.common-loader.active {
    display: flex;
}

.common-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 450px;
    padding: 35px;
    background: var(--common-bg-primary);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.common-brain-container {
    width: 220px;
    height: 220px;
    position: relative;
    margin-bottom: 25px;
}

.common-network-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(60, 141, 153, 0.1) 0%, rgba(111, 204, 180, 0.05) 70%, rgba(255, 255, 255, 0) 100%);
    animation: common-pulse 2s infinite ease-in-out;
}

.common-network-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.common-network-inner {
    position: absolute;
    width: 100%;
    height: 100%;
}

.common-node {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--common-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(60, 141, 153, 0.5);
}

.common-node-center {
    width: 12px;
    height: 12px;
    background: var(--common-primary);
    box-shadow: 0 0 15px rgba(60, 141, 153, 0.8);
    animation: common-pulse-center 2s infinite ease-in-out;
}

@keyframes common-pulse-center {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

.common-connection {
    position: absolute;
    background: rgba(60, 141, 153, 0.15);
    transform-origin: 0 0;
    z-index: -1;
    height: 2px;
}

.common-connection.pulse {
    animation: common-connectionPulse 1.5s infinite;
}

.common-data-packet {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--common-primary);
    border-radius: 50%;
    top: -1px;
    animation: common-data-flow-back-forth 2s linear infinite;
}

@keyframes common-data-flow-back-forth {
    0% { left: 0; }
    50% { left: 100%; }
    100% { left: 0; }
}

@keyframes common-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.7; }
}

@keyframes common-connectionPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.6; }
}

.common-loading-text {
    margin: 20px 0 15px;
    font-size: 18px;
    font-weight: 500;
    color: var(--common-text-primary);
    text-align: center;
    height: 28px;
}

#common-loading-message {
    transition: opacity 0.4s ease;
    display: inline-block;
    min-width: 340px;
    text-align: center;
    color: var(--common-primary);
    font-weight: 600;
}

.common-progress-indicator {
    width: 100%;
    height: 6px;
    background: var(--common-bg-secondary);
    border-radius: 8px;
    margin: 10px 0 20px;
    position: relative;
    overflow: hidden;
}

.common-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--common-primary), var(--common-secondary));
    border-radius: 8px;
    transition: width 0.3s ease;
}

.common-search-terms {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
    max-width: 340px;
}

.common-term {
    padding: 4px 10px;
    background: rgba(60, 141, 153, 0.1);
    color: var(--common-primary);
    border-radius: 15px;
    margin: 0 5px 8px;
    font-size: 13px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.common-term.active {
    opacity: 1;
}

.common-status-info {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--common-text-secondary);
}

/* 파티클 효과 */
.common-particles-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

.common-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: rgba(60, 141, 153, 0.15);
    pointer-events: none;
}

/* 문서 스타일 */
.common-documents-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 3;
}

.common-orbit-document {
    position: absolute;
    width: 40px;
    height: 55px;
    background: var(--common-bg-primary);
    border-radius: 4px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.common-orbit-document.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: common-document-appear 0.6s forwards;
}

.common-orbit-document.found {
    box-shadow: 0 0 0 2px var(--common-primary), 0 5px 15px rgba(60, 141, 153, 0.3);
    z-index: 10;
    animation: common-float 2s infinite ease-in-out;
}

.common-document-icon {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
}

.common-doc-title {
    width: 70%;
    height: 4px;
    background: var(--common-gray-200);
    margin-bottom: 5px;
    border-radius: 2px;
}

.common-doc-line {
    width: 70%;
    height: 2px;
    background: var(--common-gray-200);
    margin-bottom: 3px;
    border-radius: 2px;
}

.common-found-document .common-doc-title {
    background: var(--common-primary);
}

.common-found-document .common-doc-line {
    background: rgba(60, 141, 153, 0.2);
}

.common-document-detail {
    position: absolute;
    background: var(--common-bg-primary);
    border: 1px solid var(--common-border);
    border-radius: 8px;
    padding: 12px;
    width: 180px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    font-size: 12px;
    z-index: 30;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    transform: translateY(10px);
}

.common-document-detail.visible {
    opacity: 1;
    transform: translateY(0);
}

.common-detail-title {
    font-weight: 600;
    color: var(--common-primary);
    margin-bottom: 5px;
}

.common-detail-text {
    color: var(--common-text-secondary);
    line-height: 1.4;
}

.common-doc-relevance {
    display: flex;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--common-primary);
}

.common-relevance-bar {
    height: 4px;
    width: 70px;
    background: var(--common-gray-200);
    border-radius: 2px;
    margin-left: 5px;
    overflow: hidden;
}

.common-relevance-fill {
    height: 100%;
    background: var(--common-primary);
}

/* 애니메이션 */
@keyframes common-float {
    0%, 100% { transform: translate(-50%, -50%) scale(1.3); }
    50% { transform: translate(-50%, -60%) scale(1.3); }
}

/* 문서 등장 애니메이션 */
@keyframes common-document-appear {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    40% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.common-detail-tag {
    display: inline-block;
    background: rgba(111, 204, 180, 0.2);
    color: var(--common-primary);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
    margin-bottom: 4px;
}

.common-detail-footer {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--common-text-secondary);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .common-loading-container {
        padding: 25px 20px;
        width: calc(100% - 40px);
        margin: 0 20px;
    }
    
    .common-brain-container {
        width: 180px;
        height: 180px;
    }
    
    .common-loading-text {
        font-size: 16px;
    }
    
    #common-loading-message {
        min-width: 0;
        width: 100%;
    }
    
    .common-search-terms {
        max-width: 100%;
    }
    
    .common-term {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .common-document-detail {
        width: 150px;
        padding: 10px;
        font-size: 11px;
    }
    
    /* 세부 정보 위치 모바일 최적화 */
    .common-orbit-document .common-document-detail {
        left: 45px;
        top: -10px;
    }
    
    /* 중앙 결과 문서의 세부 정보 위치 조정 */
    .common-orbit-document.found .common-document-detail {
        top: -120px;
        left: 0;
    }
}

 /* 모바일 디바이스 테두리 */
  .device-wrapper {
    width: 380px; /* 고정 너비 */
    height: 740px; /* 고정 높이 */
    margin: 20px auto;
    
    border: 0;
    border-radius: 36px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    background-color: white;
    flex-shrink: 0;
  }
  
  /* 모바일 디바이스 상단 노치 */
  .device-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 25px;
    background-color: #111;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    z-index: 1000;
  }
  
  .device-screen {
    height: 100%;
    overflow-y: auto;
    position: relative;
  }
  
  /* 데스크톱 모드에서 헤더 수정 */
  @media (min-width: 769px) {
    /* 헤더와 탭바 컨테이너 스타일 */
    .header, .tab-bar {
      max-width: 100%;
      width: 100%;
      height:70px;
    }
    
    /* 고정 요소들을 absolute로 변경 (device-wrapper 내부 기준) */
    .header .top-bar {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      width: 100%;
      box-sizing: border-box;
    }
    
    .header .search-bar {
      position: absolute;
      top: 60px;
      left: 0;
      right: 0;
      width: 100%;
      box-sizing: border-box;
    }
    
    /* 탭바도 absolute로 변경 */
    .tab-bar {
      position: sticky;
      bottom: 0;
      left: 0;
      right: 0;
    }
    
    /* common-loader를 absolute로 변경하여 device-wrapper 내에 표시 */
    .common-loader {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 9999;
    }
    
    /* 로딩 컨테이너 크기 조정 */
    .common-loading-container {
      max-width: 90%;
      padding: 20px;
    }
    
    .common-brain-container {
      width: 180px;
      height: 180px;
    }
    
    #common-loading-message {
      min-width: 0;
      width: 90%;
    }
  }
 @media (max-width: 769px) {
  .device-wrapper{ 
  		width:100%;
  	}
  	.header .top-bar {
	    padding: 0.75rem;
	}
	.header .profile-section{
		margin-top: 30px;
	}
  	
 }
 
  /* 데스크톱에서만 모바일 프레임 표시 */
  @media (min-width: 769px) {
    body {
      background-color: #e0e0e0;
      display: flex;
      justify-content: center;
      min-height: 100vh;
      padding: 20px;
    }
    
    .device-frame {
      display: block;
      width: 380px;
      height: 740px;
      border: 12px solid #111;
      border-radius: 36px;
      overflow: hidden;
      position: relative;
      box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }
    .device-wrapper{
     	border: 12px solid #111;
    }
    .device-frame-notch {
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 150px;
      height: 25px;
      background-color: #111;
      border-bottom-left-radius: 14px;
      border-bottom-right-radius: 14px;
      z-index: 1000;
    }
    
    /* 실제 컨텐츠를 감싸는 영역 */
    .device-content {
      width: 100%;
      height: 100%;
      overflow-y: auto;
      background-color: white;
    }
    
    /* 헤더와 탭 바 스타일 조정 */
    .device-content .header .top-bar {
      width: 100%;
      box-sizing: border-box;
      position: sticky; /* position:fixed 대신 sticky 사용 */
      top: 0;
    }
    
    .device-content .header .search-bar {
      width: 100%;
      box-sizing: border-box;
      position: sticky; /* fixed 대신 sticky 사용 */
      top: 60px;
    }
    
    .device-content .tab-bar {
      width: 100%;
      box-sizing: border-box;
      position: sticky; /* fixed 대신 sticky 사용 */
      bottom: 0;
    }
    
    /* 로딩 요소 조정 */
    #commonWelfareLoader {
      position: absolute !important;
      top: 0 !important;
      left: 0 !important;
      width: 100% !important;
      height: 100% !important;
    }
    
    /* 로딩 컨테이너 크기 조정 */
    .common-loading-container {
      max-width: 90% !important;
      padding: 20px !important;
    }
    
    .common-brain-container {
      width: 150px !important;
      height: 150px !important;
    }
    
    #common-loading-message {
      min-width: 0 !important;
      width: 90% !important;
    }
  }
  
    
  /* 모바일 화면 시뮬레이션 - 기본적으로 숨김 */
  .device-frame {
    display: none;
  }
  
  /* 모바일 콘텐츠 - 기본적으로 표시 */
  .mobile-content {
    display: block;
  }
  
  
/* 모바일 전용 추가 스타일 */
@media (max-width: 768px) {
    .tab-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
    }
    
    /* 메인 콘텐츠 영역에 하단 패딩 추가 */
    .main-content {
        padding-bottom: 80px;
    }
}
  