/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: "Poppins", sans-serif;
    background-color: #f8f8f8;
    color: #333;
    margin: 0;
    padding: 0;
  }
  
  a {
    text-decoration: none;
    color: inherit;
  }
  
  ul {
    list-style: none;
  }
  
  /* 공통 애니메이션 효과 */
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }
  
  @keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  
  /* Header Styles */
  header {
    background-color: #ffffff;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 80px; /* 모든 페이지에서 공통 사용 */
    position: relative;
    z-index: 1000;
  }
  
  .logo {
    font-weight: 600;
    color: #ff0000; /* YouTube Red */
    display: flex;
    align-items: center;
  }
  
  .logo a {
    display: flex;
    align-items: center;
    height: 100%; /* 이미지 세로 중앙 정렬 */
  }
  
  .logo a img {
    width: 100px; /* 원래 너비로 수정 */
  }
  
  /* 모바일 햄버거 메뉴 아이콘 */
  .mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    background: none;
    border: none;
    padding: 5px;
  }
  
  /* 헤더 네비게이션 */
  header nav {
    display: flex;
    align-items: center;
    flex: 1;
  }
  
  nav ul {
    display: flex;
    gap: 20px;
    align-items: center;
    width: 100%;
    justify-content: space-between;
  }
  
  nav a {
    font-weight: 500;
    color: #333;
    transition: color 0.3s ease;
  }
  
  nav a:hover {
    color: #ff0000;
  }
  
  /* 유저 정보 스타일 */
  .user-info {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    position: relative;
    cursor: pointer;
  }
  
  .user-info i {
    margin-right: 10px;
    font-size: 1.1rem;
    color: #555555;
  }

  /* User Info Dropdown Styles */
  .dropdown-arrow {
    margin-left: 8px;
    font-size: 0.8em;
    transition: transform 0.3s ease;
  }

  .user-info.open .dropdown-arrow {
    transform: rotate(180deg);
  }

  .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    min-width: 180px;
    z-index: 1001;
    margin-top: 5px;
    overflow: hidden;
  }

  .dropdown-menu.show {
    display: block;
    animation: fadeInUp 0.2s ease-out;
  }

  .dropdown-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
    align-items: stretch;
  }

  .dropdown-menu li {
    margin: 0;
    width: 100%;
  }

  .dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #333;
    font-size: 0.9rem;
    font-weight: 400;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .dropdown-menu a:hover {
    background-color: #f5f5f5;
    color: #ff0000;
  }

  .dropdown-menu a i {
    margin-right: 10px;
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    color: #666;
    transition: color 0.2s ease;
  }

  .dropdown-menu a:hover i {
    color: #ff0000;
  }

  /* User section styling for right alignment */
  .user-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
  }

  @media (min-width: 768px) {
    .user-section {
      justify-content: flex-end;
    }
  }
  
  /* 구독 정보 뱃지 스타일 */
  header .subscription-info {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
  }

  .plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-right: 8px;
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
    border: 1px solid rgba(255,255,255,0.3);
    text-shadow: none;
    letter-spacing: 0;
    height: 28px;
  }

  .plan-badge i {
    margin-right: 6px;
    font-size: 1rem;
    vertical-align: middle;
    filter: none;
  }

  .plan-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
      to right,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,0.3) 50%,
      rgba(255,255,255,0) 100%
    );
    transform: rotate(45deg);
    animation: shiningEffect 3s infinite;
    z-index: 1;
  }

  .plan-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0;
    z-index: -1;
  }

  .plan-badge span {
    position: relative;
    z-index: 2;
  }

  .plan-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    filter: brightness(1.05);
    text-decoration: none;
  }

  .plan-badge:hover::after {
    opacity: 0.3;
  }

  @keyframes shiningEffect {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
  }

  /* 모든 플랜 배지 공통 스타일 */
  .plan-badge.bronze, 
  .plan-badge.silver, 
  .plan-badge.gold, 
  .plan-badge.no-plan {
    font-size: 0.95rem;
    font-weight: 500;
    text-shadow: none;
    height: 30px;
  }

  .plan-badge.bronze span, 
  .plan-badge.silver span, 
  .plan-badge.gold span, 
  .plan-badge.no-plan span {
    font-size: 0.95rem;
    font-weight: 500;
  }

  .plan-badge.bronze {
    background: linear-gradient(135deg, #cd7f32, #ffb497, #b87333);
    color: #000000;
    border: 1px solid #a0522d;
  }

  .plan-badge.silver {
    background: linear-gradient(135deg, #e3e3e3, #ffffff, #d7d7d7);
    color: #333;
    border: 1px solid #f0f0f0;
  }

  .plan-badge.gold {
    background: linear-gradient(135deg, #ffd700, #ffe44e, #ffed4a);
    color: #333;
    border: 1px solid #ffe066;
    animation: pulse-badge 2s infinite alternate;
  }

  /* No Plan 배지 스타일 */
  .plan-badge.no-plan {
    background: rgb(240, 240, 240);
    color: rgb(78, 78, 78);
  }

  /* 모든 배지에 공통 애니메이션 적용 */
  @keyframes pulse-badge {
    0% { box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); }
    100% { box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); }
  }

  /* 남은 영상 개수 배지 스타일 */
  .video-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    background-color: #f8f8f8;
    color: #333;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    font-weight: 500;
    transition: all 0.2s ease;
    margin-left: 6px;
  }

  .video-count-badge:hover {
    background-color: #f0f0f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  }

  .video-count-badge i.fa-video {
    color: #ff0000;
    margin-right: 6px;
    font-size: 0.8rem;
  }

  .video-count-badge .count {
    font-weight: 600;
    color: #ff0000;
  }

  .video-count-badge .total {
    color: #666;
  }

  .subscription-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
  }

  /* Button Styles */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
  }
  
  .btn.primary {
    background: linear-gradient(135deg, #ff6b00, #e60000);
    color: white;
    font-weight: 600;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 5px 15px rgba(230, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    text-decoration: none;
  }
  
  .btn.primary i {
    margin-right: 8px;
  }
  
  .btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(230, 0, 0, 0.3);
  }
  
  .btn.primary::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.5s ease;
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 50%;
    opacity: 0;
  }
  
  .btn.primary:hover::before {
    width: 0;
    height: 0;
    opacity: 1;
  }
  
  /* Form Common Styles */
  .form-group {
    margin-bottom: 20px;
  }
  
  .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #555;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
  }
  
  .form-group input:focus,
  .form-group textarea:focus,
  .form-group select:focus {
    border-color: #ff0000;
    outline: none;
  }
  
  /* Footer Styles */
  footer {
    background-color: #ffffff;
    text-align: center;
    padding: 20px 40px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    color: #777;
  }
  
  /* 모바일 메뉴 항목 스타일 */
  .mobile-menu-item {
    display: none;
  }

  .mobile-menu-divider {
    display: none;
  }

  /* Responsive Design - 통합된 미디어 쿼리 */
  @media (max-width: 840px) {
    /* 헤더 스타일 */
    header {
      padding: 0 20px;
      height: 70px;
      flex-wrap: nowrap;
      flex-direction: row;
      align-items: center;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      z-index: 1010;
    }
    
    /* Add padding to body to prevent content from being hidden under fixed header */
    body {
      padding-top: 70px;
    }
    
    .mobile-menu-toggle {
      display: block;
      order: 3;
      margin-left: 15px;
    }
    
    header nav {
      position: fixed;
      top: 70px;
      right: -300px;
      width: 280px;
      height: calc(100vh - 70px);
      background-color: #ffffff;
      box-shadow: -2px 0 5px rgba(0,0,0,0.1);
      transition: right 0.3s ease;
      flex-direction: column;
      align-items: flex-start;
      padding: 20px;
      overflow-y: auto;
      z-index: 999;
    }
    
    /* 햄버거 메뉴 열림 */
    header nav.open {
      right: 0;
    }
    
    nav ul {
      flex-direction: column;
      width: 100%;
      margin-top: 0;
      gap: 15px;
      align-items: flex-start;
    }
    
    nav li {
      width: 100%;
      margin-bottom: 10px;
    }
    
    /* 모바일 메뉴 항목 표시 */
    .mobile-menu-item {
      display: block;
      width: 100%;
    }
    
    .mobile-menu-item a {
      display: flex;
      align-items: center;
      padding: 12px 15px;
      border-radius: 4px;
      background-color: #f8f9fa;
      font-weight: 500;
      transition: all 0.2s ease;
    }
    
    .mobile-menu-item a i {
      width: 24px;
      text-align: center;
      margin-right: 10px;
      font-size: 1rem;
    }
    
    .mobile-menu-item a:hover {
      background-color: #f0f0f0;
    }
    
    .mobile-menu-item a.active {
      background-color: rgba(230, 0, 0, 0.1);
      color: #e60000;
    }
    
    /* 구분선 표시 */
    .mobile-menu-divider {
      display: block;
      width: 100%;
      height: 1px;
      background-color: #e9ecef;
      margin: 10px 0;
    }
    
    nav a {
      padding: 12px 15px;
      border-radius: 4px;
      background-color: #f8f9fa;
      display: block;
      width: 100%;
      font-weight: 500;
    }
    
    .user-info {
      width: 100%;
      justify-content: flex-start;
      margin: 10px 0;
      padding: 10px 15px;
      border-radius: 4px;
      background-color: #f5f5f5;
      font-size: 0.9rem;
      display: flex;
      align-items: center;
    }
    
    .user-info span {
        font-size: 0.7rem; /* 이메일 폰트 크기 축소 */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px; /* 필요에 따라 최대 너비 조정 */
        display: inline-block; /* ellipsis 적용을 위해 */
    }

    .user-info > i:first-child {
        font-size: 1rem;
        margin-right: 10px;
    }

    .user-info .dropdown-arrow {
        font-size: 0.7em;
        margin-left: auto;
    }

    /* 모바일 뷰 드롭다운 메뉴 너비 조정 */
    .dropdown-menu {
      position: absolute; /* Ensure absolute positioning is maintained */
      left: 15px; /* Align with the padding of user-info */
      right: auto; /* Override desktop style */
      width: auto; /* Allow content to determine width */
      min-width: 210px; /* Set a reasonable minimum width */
      max-width: "100%"; /* Prevent overflow, considering padding */
      top: auto; /* 위쪽 위치 자동 설정 */
      bottom: 100%; /* 버튼 상단에 메뉴 하단 정렬 */
    }

    /* 모바일 드롭다운 메뉴 글자/아이콘 크기 및 패딩 조정 */
    .dropdown-menu a {
      font-size: 0.75rem; /* 글자 크기 줄이기 */
    }

    .dropdown-menu a i {
      font-size: 0.75rem; /* 아이콘 크기 약간 줄이기 */
      margin-right: 4px; /* 아이콘과 텍스트 간격 조정 */
    }

    .subscription-info {
      width: 100%;
      flex-direction: column;
      align-items: flex-start;
      margin-top: 5px;
      margin-bottom: 15px;
    }
    
    .plan-badge {
      width: 100%;
      padding: 10px 15px;
      margin-bottom: 8px;
      font-size: 1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5em;
    }
    
    .video-count-badge {
      margin-left: 0;
      width: 100%;
      display: flex;
      justify-content: center;
      padding: 8px 12px;
    }
    
    /* 헤더에 있는 버튼 스타일 */
    header .btn {
      width: 100%;
      text-align: center;
      padding: 12px 15px;
      margin-bottom: 10px;
    }
    
    /* 모바일 화면에서 오버레이 */
    .mobile-overlay {
      display: none;
      position: fixed;
      top: 70px;
      left: 0;
      width: 100%;
      height: calc(100vh - 70px);
      background-color: rgba(0, 0, 0, 0.5);
      z-index: 998;
    }
    
    .mobile-overlay.open {
      display: block;
    }
    
    /* 모바일에서 로그인/로그아웃 버튼 스타일 */
    .login-btn, .logout-btn {
      background-color: #ff0000;
      color: white;
      border-radius: 4px;
      font-weight: 600;
      text-align: center;
      display: block;
      width: 100%;
    }
    
    /* 버튼 모바일 최적화 */
    .btn {
      display: block;
      width: 100%;
      text-align: center;
      margin-bottom: 10px;
      padding: 14px 20px;  /* 터치 영역 확대 */
    }

    /* 폼 요소 모바일 최적화 */
    .form-group input,
    .form-group textarea,
    .form-group select {
      padding: 15px;  /* 입력 영역 확대 */
      font-size: 16px;  /* iOS에서 자동 확대 방지 */
    }
    
    /* 모바일에서 카드 스타일 조정 */
    .card-container {
      flex-direction: column;
    }
    
    .card {
      width: 100%;
      margin-bottom: 15px;
    }
    
    /* User section styling for mobile */
    .user-section {
      width: 100%;
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
      margin-left: 0;
    }
    
    /* 사이드바 관련 스타일 */
    .main-container {
      flex-direction: column;
    }
    
    .sidebar {
      width: 100%;
      order: 2;
      padding: 15px;
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease-out, width 0s;
      box-shadow: none;
      border-right: none;
      border-top: 1px solid #f0f0f0;
    }
    
    .sidebar.open {
      max-height: 1000px;
      overflow: visible;
    }
    
    .sidebar-close {
      display: block;
    }
    
    .sidebar-header {
      padding-top: 5px;
    }
    
    .sidebar-menu {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    
    .sidebar-menu li {
      margin-bottom: 0;
    }
    
    .sidebar-menu a {
      padding: 12px 15px;
      font-size: 0.95rem;
    }
    
    .sidebar-menu i {
      font-size: 1rem;
      width: 24px;
    }
    
    .sidebar-section {
      width: 100%;
      margin-bottom: 15px;
    }
    
    .sidebar-stats {
      margin-bottom: 10px;
    }
    
    .main-content {
      order: 1;
      padding: 15px 12px;
    }
    
    .main-content-full {
      padding: 15px 12px;
    }
    
    /* 모바일에서 테이블 스타일 */
    table {
      display: block;
      overflow-x: auto;
      white-space: nowrap;
      font-size: 0.9rem;
    }
    
    /* 모바일에서 그리드 레이아웃 */
    .grid-container {
      grid-template-columns: 1fr;
    }
    
    .sidebar-toggle-btn {
      display: flex;
    }
    
    /* 터치 상호작용 개선 */
    button, 
    .btn, 
    select,
    input[type="submit"],
    input[type="button"] {
      min-height: 44px;  /* 애플 권장 최소 터치 영역 */
    }
  }

  /* Additional styles for even smaller screens */
  @media (max-width: 480px) {
    header {
      padding: 12px 15px;
    }
    
    nav ul {
      gap: 8px;
    }
    
    nav a {
      font-size: 0.9rem;
      padding: 8px 12px;  /* 터치 영역 확대 */
    }
    
    .btn {
      padding: 12px 15px;
      font-size: 0.95rem;
    }
    
    .plan-badge {
      font-size: 0.8rem;
      padding: 6px 10px;  /* 터치 영역 확대 */
      display: block;
      margin-bottom: 5px;
      width: 100%;
      text-align: center;
    }
    
    /* 글자 크기 최적화 */
    h1 {
      font-size: 1.8rem;
    }
    
    h2 {
      font-size: 1.5rem;
    }
    
    h3 {
      font-size: 1.2rem;
    }
    
    p {
      font-size: 0.95rem;
      line-height: 1.5;
    }
    
    /* 모바일 화면에서 이미지 최적화 */
    img {
      max-width: 100%;
      height: auto;
    }
    
    /* FAQ 항목 간격 조정 */
    .faq-item {
      margin-bottom: 20px;
      padding: 15px;
    }
  }

  /* 사이드바 및 레이아웃 스타일 */
  .main-container {
    display: flex;
    min-height: calc(100vh - 140px);
    transition: flex-direction 0.3s ease;
  }

  .sidebar {
    width: 220px;
    background-color: #ffffff;
    padding: 15px;
    box-shadow: 1px 0 3px rgba(0,0,0,0.05);
    transition: width 0.3s ease, max-height 0.3s ease;
    z-index: 990;
    position: relative;
    border-right: 1px solid #f0f0f0;
  }

  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
  }

  .sidebar-title {
    font-size: 1.1rem;
    color: #444;
    font-weight: 600;
    margin: 0;
  }

  .sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
  }

  .sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .sidebar-menu li {
    margin-bottom: 5px;
  }

  .sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 0.9rem;
    background-color: transparent;
  }

  .sidebar-menu a span {
    margin-left: 8px;
  }

  .sidebar-menu a:hover {
    background-color: #f9f9f9;
    color: #ff0000;
  }

  .sidebar-menu i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
  }

  .sidebar-section {
    margin-top: 20px;
  }

  .sidebar-section h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
  }

  .sidebar-section h3 i {
    margin-right: 8px;
    font-size: 0.9rem;
    color: #888;
  }

  /* 사이드바 활성화 메뉴 스타일 */
  .sidebar-menu a:focus,
  .sidebar-menu a.active {
    background-color: rgba(255, 0, 0, 0.08);
    color: #ff0000;
    font-weight: 500;
  }

  /* 사이드바 구독 정보 스타일 */
  .sidebar-stats {
    background-color: #fcfcfc;
    padding: 12px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #f0f0f0;
  }

  .sidebar-subscription-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .sidebar-plan {
    font-weight: 600;
    padding: 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.2);
  }

  .sidebar-plan::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
      to right,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,0.3) 50%,
      rgba(255,255,255,0) 100%
    );
    transform: rotate(45deg);
    animation: shiningEffect 3s infinite;
    z-index: 1;
  }

  .sidebar-plan i {
    margin-right: 8px;
    font-size: 1.1em;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    z-index: 2;
  }

  .sidebar-plan:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    text-decoration: none;
  }

  .sidebar-plan.bronze {
    background: linear-gradient(135deg, #cd7f32, #ffb497, #b87333);
    color: #000000;
    border: 1px solid #a0522d;
  }

  .sidebar-plan.silver {
    background: linear-gradient(135deg, #e3e3e3, #ffffff, #d7d7d7);
    color: #333;
    border: 1px solid #f0f0f0;
  }

  .sidebar-plan.gold {
    background: linear-gradient(135deg, #ffd700, #ffe44e, #ffed4a);
    color: #333;
    border: 1px solid #ffe066;
    animation: pulse-gold 2s infinite alternate;
  }

  .main-content {
    flex: 1;
    padding: 12px;
    position: relative;
  }

  .main-content-full {
    flex: 1;
    padding: 12px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
  }

  /* 사이드바 토글 버튼 */
  .sidebar-toggle-btn {
    display: none;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 15px;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 15px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }

  .sidebar-toggle-btn i {
    margin-right: 8px;
  }

  .sidebar-toggle-btn:hover {
    background-color: #e9ecef;
  }

  /* 모든 플랜 배지의 hover 스타일 */
  .plan-badge.bronze:hover, 
  .plan-badge.silver:hover, 
  .plan-badge.gold:hover, 
  .plan-badge.no-plan:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    filter: brightness(1.05);
  }

  /* 모달 스타일 */
  .modal {
    display: none; /* 기본적으로 숨김 */
    position: fixed; /* 화면에 고정 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050; /* 헤더보다 위에 표시 */
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .modal.show {
    display: flex; /* 보일 때 flex로 설정 */
  }

  .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* 반투명 배경 */
    animation: fadeIn 0.3s ease-out;
  }

  .modal-content {
    position: relative;
    background-color: #ffffff;
    padding: 30px 35px; /* 패딩 조정 */
    border-radius: 10px; /* 약간 더 둥글게 */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* 그림자 강화 */
    z-index: 1051;
    width: 90%;
    max-width: 550px; /* 최대 너비 약간 증가 */
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
    border-top: none; /* Remove solid border */
    position: relative; /* Needed for pseudo-element */
  }

  /* Add gradient top border using pseudo-element */
  .modal-content::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
      background: linear-gradient(90deg, #ff6b00, #e60000);
  }

  .modal h2 {
    margin-top: 0;
    margin-bottom: 25px; 
    font-size: 1.6rem; 
    color: #333;
    font-weight: 600; 
    text-align: center; 
    padding-bottom: 15px;
    position: relative; /* Needed for pseudo-element border */
  }

  /* Add gradient bottom border using pseudo-element */
  .modal h2::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 60px; /* Adjust width as needed */
      height: 2px;
      background: linear-gradient(90deg, #ff6b00, #e60000);
  }

  /* 모달 닫기 버튼 스타일 */
  .close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
  }

  .close-modal-btn:hover {
    color: #333;
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
  }

  /* 모달 내 구독 정보 섹션 스타일 */
  .current-subscription-info {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
  }

  .current-subscription-info p {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
  }

  .current-subscription-info p:last-child {
    margin-bottom: 0;
  }

  .current-subscription-info strong {
    color: #333;
    margin-right: 5px;
    font-weight: 600;
  }

  /* 모달 내 액션 버튼 섹션 스타일 */
  .subscription-actions {
    margin-top: 20px;
    text-align: right; /* 버튼 오른쪽 정렬 */
    padding-top: 20px;
    border-top: 1px solid #eee; /* 상단 구분선 */
  }

  /* 구독 취소 버튼 특정 스타일 */
  #cancel-subscription-btn {
    background: linear-gradient(90deg, #ff6b00, #e60000); /* Apply gradient */
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 5px;
    transition: filter 0.2s ease, box-shadow 0.2s ease; /* Adjust transition */
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }

  #cancel-subscription-btn:hover {
    filter: brightness(1.1); /* Make brighter on hover */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  }
  
  #cancel-subscription-btn:disabled {
      background: #ccc;
      cursor: not-allowed;
      box-shadow: none; /* Remove shadow when disabled */
      filter: none;
  }

  /* Sidebar Expiration Notice specific style */
  .sidebar-subscription-info .expiration-notice {
    font-size: 0.75rem; /* Smaller font size */
    color: #888; /* Lighter color */
    margin-left: 0; /* No left margin in sidebar */
    margin-top: 4px; /* Add some space below the plan badge */
    display: block; /* Take full width in sidebar */
    text-align: center; /* Center align in sidebar */
  }

  .close-welcome-modal-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: 300;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
  }
  .close-welcome-modal-button:hover {
    color: #333;
  }
  /* Welcome Popup Specific Styles */
  .welcome-modal-content {
    text-align: center;
    padding: 0;
    overflow: hidden; /* For border-radius on children */
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-50px);
    opacity: 0;
    animation: slideDownFadeIn 0.5s ease-out forwards;
  }

  @keyframes slideDownFadeIn {
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .welcome-modal-content .modal-header {
    background: linear-gradient(135deg, #ff2e2e 0%, #ffa231 100%);
    color: white;
    position: relative;
    border-bottom: none;
    padding: 20px;
  }

  .welcome-modal-content .welcome-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
  }

  .welcome-modal-content .welcome-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
  }

  .welcome-modal-content .close-welcome-modal-button {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
  }

  .welcome-modal-content .close-welcome-modal-button:hover {
      color: white;
  }

  .welcome-modal-content .modal-body {
    padding: 30px 35px;
    color: #444;
  }

  .welcome-modal-content .welcome-message {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
  }

  .welcome-modal-content .welcome-submessage {
    font-size: 0.95rem;
    color: #777;
    margin-top: 15px;
  }

  .welcome-modal-content .modal-footer {
    padding: 0 35px 30px 35px;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    margin-top: 20px;
  }
  .welcome-modal-content .modal-footer .btn.primary {
      width: 100%;
      font-size: 1.1rem;
      padding: 12px;
      box-shadow: 0 4px 15px rgba(242, 88, 88, 0.3);
  }

  .welcome-modal-content .modal-footer .btn.primary {
    box-shadow: 0 4px 15px rgba(230, 0, 0, 0.2);
    padding: 12px 28px;
  }

  /* --- Promotion Styles --- */

  body.promotion-banner-active {
    padding-top: 48px; /* Match banner height */
  }

  .promotion-banner {
    background: linear-gradient(90deg, #e60000, #ff4444);
    color: white;
    padding: 12px 20px;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1040;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .promotion-banner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
  }

  .promotion-banner p {
    margin: 0;
    font-weight: 500;
    font-size: 0.9em;
  }

  .promotion-banner .btn-upgrade {
      padding: 6px 14px;
      font-size: 0.85em;
      background: white;
      color: #e60000;
      font-weight: bold;
      border: none;
      border-radius: 6px;
      text-decoration: none;
      transition: background-color 0.2s, color 0.2s;
  }

  .promotion-banner .btn-upgrade:hover {
      background: #f0f0f0;
  }

  /* Promotion Popup */
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    animation: fadeIn 0.3s ease-out;
  }

  .promotion-modal-content {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: fadeInScale 0.3s ease-out;
  }

  @keyframes fadeInScale {
    from {
      opacity: 0;
      transform: scale(0.9);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  .promotion-modal-content .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
  }

  .promotion-modal-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e60000;
    margin-top: 0;
    margin-bottom: 15px;
  }

  .promotion-modal-content p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #444;
  }

  .promotion-modal-content .timer {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    background: #f0f0f0;
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    margin: 10px 0 20px;
  }

  .modal-content .current-subscription-info p,
  .modal-content .subscription-actions {
    margin-bottom: 1rem;
  }

  /* 구독 관리 모달 전용 스타일 */
  .subscription-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
  }

  .subscription-details p {
    margin: 8px 0;
    color: #333;
  }

  .subscription-details strong {
    color: #222;
    font-weight: 600;
  }

  .plan-name {
    color: #ff6b00;
    font-weight: 600;
    text-transform: capitalize;
  }

  .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .status-active {
    background: #d4edda;
    color: #155724;
  }

  .status-canceled {
    background: #f8d7da;
    color: #721c24;
  }

  .status-cancel-scheduled {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
  }

  .status-trialing {
    background: #d1ecf1;
    color: #0c5460;
  }

  .cancellation-notice {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 15px;
    margin: 12px 0 0 0;
  }

  .cancellation-notice i {
    display: none;
  }

  .cancellation-notice p {
    margin: 0;
    color: #666;
    font-size: 0.75rem;
    line-height: 1.3;
    text-align: left;
  }

  .management-note {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 15px;
    margin: 12px 0 15px 0;
  }

  .management-note p {
    margin: 0;
    color: #666;
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: left;
  }

  .no-subscription {
    text-align: center;
    padding: 30px 20px;
  }

  .no-subscription i {
    font-size: 2rem;
    color: #6c757d;
    margin-bottom: 15px;
  }

  .no-subscription p {
    color: #6c757d;
    margin-bottom: 15px;
  }

  .subscription-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
  }

  .btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
  }

  .btn-danger:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  .btn-danger i.fa-spinner {
    animation: spin 1s linear infinite;
  }

  .btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .btn-success:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
  }

  .btn-success:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  .btn-success i.fa-spinner {
    animation: spin 1s linear infinite;
  }

  .reactivation-note {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 15px;
  }

  .reactivation-note p {
    margin: 0;
    color: #666;
    font-size: 0.75rem;
    line-height: 1.3;
    text-align: left;
  }

  @keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }

  /* User Profile Page Styles */
  .user-profile-container {
    padding: 2rem;
    max-width: 800px;
    margin: 2rem auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }

  .user-profile-container .page-title {
    margin-bottom: 2rem;
    color: #333;
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
  }

  .profile-card {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden; /* Ensures child elements respect border radius */
  }

  .profile-header {
    background-color: #f0f2f5;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
  }

  .profile-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
  }

  .profile-body {
    padding: 1.5rem;
  }

  .info-group {
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
    font-size: 1rem;
  }

  .info-group:last-child {
    margin-bottom: 0;
  }

  .info-group label {
    font-weight: 600;
    color: #555;
    width: 180px; /* Fixed width for alignment */
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  .info-group label i {
    margin-right: 10px;
    color: #888;
    width: 20px; /* Icon alignment */
    text-align: center;
  }

  .info-group p {
    margin: 0;
    color: #333;
    word-break: break-all;
  }

  .user-profile-container .btn-primary {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 5px;
  }

  .account-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    text-align: right;
  }

  .text-danger-btn {
    background: none;
    border: none;
    color: #c53030;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 5px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
  }

  .text-danger-btn:hover {
    color: #e53e3e;
    text-decoration: underline;
  }

  .text-danger-btn:disabled {
    color: #999;
    cursor: not-allowed;
    background-color: transparent;
  }

  .text-secondary-btn {
    background: none;
    border: none;
    color: #6c757d; /* Bootstrap's secondary color */
    font-weight: 500;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-decoration: underline;
  }

  .text-secondary-btn:disabled {
    color: #999;
    cursor: not-allowed;
    background-color: transparent;
  }