/**
 * BuddyPress 네이티브 앱 공통 스타일 (CSS 변수 및 기본 스타일)
 * 
 * @package Nexi_Native_App_Theme
 * @since 1.0.0
 * 
 * 페이지별 스타일:
 * - groups-list.css: 그룹 리스트 페이지
 * - groups-create.css: 그룹 생성 페이지
 */

/* ==========================================================================
   CSS 변수 정의
   ========================================================================== */

:root {
  /* Colors - 당근 앱 스타일 */
  --native-primary: #ff6f0f;
  --native-primary-dark: #e85d00;
  --native-primary-light: #fff5f0;
  --native-secondary: #868e96;
  --native-success: #12b886;
  --native-danger: #fa5252;
  --native-warning: #fd7e14;

  /* Grayscale */
  --native-gray-50: #f8f9fa;
  --native-gray-100: #f1f3f5;
  --native-gray-200: #e9ecef;
  --native-gray-300: #dee2e6;
  --native-gray-400: #ced4da;
  --native-gray-500: #adb5bd;
  --native-gray-600: #868e96;
  --native-gray-700: #495057;
  --native-gray-800: #343a40;
  --native-gray-900: #212529;

  /* Typography */
  --native-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --native-font-size-xs: 12px;
  --native-font-size-sm: 13px;
  --native-font-size-base: 14px;
  --native-font-size-md: 15px;
  --native-font-size-lg: 16px;
  --native-font-size-xl: 18px;
  --native-font-size-2xl: 20px;
  --native-font-size-3xl: 24px;

  /* Spacing */
  --native-space-xs: 4px;
  --native-space-sm: 8px;
  --native-space-md: 12px;
  --native-space-base: 16px;
  --native-space-lg: 20px;
  --native-space-xl: 24px;
  --native-space-2xl: 32px;
  --native-space-3xl: 40px;

  /* Border Radius */
  --native-radius-sm: 4px;
  --native-radius-md: 8px;
  --native-radius-lg: 12px;
  --native-radius-xl: 16px;
  --native-radius-2xl: 20px;
  --native-radius-full: 9999px;

  /* Shadows */
  --native-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --native-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --native-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --native-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --native-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --native-transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --native-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --native-z-sticky: 100;
  --native-z-fab: 200;
  --native-z-modal: 1000;
}

/* ==========================================================================
   기본 스타일
   ========================================================================== */

/* BuddyPress 기본 스타일 */
.native-app-buddypress {
  font-family: var(--native-font-family);
  font-size: var(--native-font-size-base);
  line-height: 1.5;
  color: var(--native-gray-900);
  background-color: var(--native-gray-50);
}

.native-app-layout {
  padding: 0 !important;
}

.native-app-container {
  max-width: 100%;
  padding: 0;
}

/* 그룹 상세 페이지 반응형 */
#buddypress.native-app-buddypress {
  max-width: 1300px;
  margin: 0 auto;
}

#buddypress .container {
  max-width: 1300px;
  margin: 0 auto;
}

/* 모바일에서 컨테이너 패딩 제거 */
@media (max-width: 767px) {
  .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .native-app-layout {
    margin: 0 !important;
  }
}

/* ==========================================================================
   접근성 및 유틸리티
   ========================================================================== */

/* 포커스 스타일 */
.native-app-buddypress *:focus-visible {
  outline: 2px solid var(--native-primary);
  outline-offset: 2px;
}

/* 비활성화 버튼 */
.native-app-buddypress button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Screen reader only */
.sr-only,
.bp-screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   다크 모드 지원 (선택적)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --native-gray-50: #212529;
    --native-gray-100: #343a40;
    --native-gray-200: #495057;
    --native-gray-900: #f8f9fa;
  }

  .native-app-buddypress {
    background-color: #1a1d1f;
    color: #f8f9fa;
  }
}

/* ==========================================================================
   반응형 컨테이너
   ========================================================================== */

@media (min-width: 768px) {
  .native-app-container {
    max-width: 768px;
    margin: 0 auto;
  }
}

/* ==========================================================================
   부모 테마 요소 숨김 (불필요한 팝업 등)
   ========================================================================== */

/* 부모 테마 로그인 팝업 숨김 */
.jws-form-login-popup {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}