/* 로딩 화면 스타일 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: top 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.intro-text-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
}

.intro-title {
    display: inline-block;
    font-family: 'Playfair Display', serif;
    font-size: 96px;
    color: #fff;
    letter-spacing: 2px;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeIn 2s ease-in forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro-background-text {
    display: none;
}

.intro-title .letter {
    display: inline-block;
    opacity: 0;
}

/* 대시보드 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #f5f5f5;
    font-family: 'DM Sans', sans-serif;
}

.app-wrapper {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    background-color: #fff;
    border-radius: 4px;
    box-shadow:
        0 0.3px 2.2px rgba(0, 0, 0, 0.011),
        0 0.7px 5.3px rgba(0, 0, 0, 0.016),
        0 1.3px 10px rgba(0, 0, 0, 0.02),
        0 2.2px 17.9px rgba(0, 0, 0, 0.024),
        0 4.2px 33.4px rgba(0, 0, 0, 0.029),
        0 10px 80px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    margin: 0 auto;
}

.left-area {
    max-width: 190px;
    transition: all .6s linear;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 20px;
    position: relative;
    overflow-y: auto;
}

.left-area::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #51a380;
    opacity: 0.8;
    z-index: 1;
}

.left-area-content {
    position: relative;
    z-index: 2;
}

.left-area::-webkit-scrollbar {
    width: 4px;
}

.left-area::-webkit-scrollbar-track {
    background: transparent;
}

.left-area::-webkit-scrollbar-thumb {
    background: #51a380;
    border-radius: 4px;
}

.left-area::-webkit-scrollbar-thumb:hover {
    background: #3d8c6d;
}

.app-header {
    font-size: 18px;
    font-weight: 700;
    color: #232428;
    padding: 20px;
    border-bottom: 1px solid rgba(81, 163, 128, 0.2);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    background: #fff;
}

.app-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #51a380;
    opacity: 0.8;
}

.inner-text {
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
    padding: 3px 6px;
    background: #51a380;
    border-radius: 3px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 기존 close-menu 스타일 제거됨 (새로운 sidebar-close-btn으로 대체) */

.profile {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 20px;
}

.profile img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
}

.profile .profile-name {
    color: #232428;
    font-weight: 500;
    padding-right: 16px;
    background-position: center right;
    background-repeat: no-repeat;
    background-size: 16px;
}

.profile .country {
    color: #adadad;
    font-weight: 500;
}

.item-link {
    display: block;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: #adadad;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    position: relative;
    border-radius: 0 8px 8px 0;
    background: none;
}

.item-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #51a380;
    opacity: 0;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-link:not(:first-of-type) {
    margin-top: 10px;
}

.item-link.active {
    color: #499d77;
    background-color: rgba(81, 163, 128, 0.1);
    font-weight: 600;
}

.item-link.active::before {
    opacity: 1;
}

.item-link:not(.active):hover {
    color: #51a380;
    background-color: rgba(81, 163, 128, 0.05);
    transform: translateX(4px);
}

.item-link:not(.active):hover::before {
    opacity: 0.7;
}

.item-link .link-icon {
    width: 16px;
    display: inline-block;
    vertical-align: sub;
    margin-right: 8px;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-link:not(.active):hover .link-icon {
    transform: scale(1.1);
    color: #51a380;
}

.list-header {
    font-size: 13px;
    font-weight: 700;
    color: #232428;
    display: flex;
    align-items: center;
    padding: 0 0 0 18px;
    margin: 18px 0 6px 0;
    border: none;
    border-left: 3px solid #e0e4e8;
    background: none;
    box-shadow: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    min-height: 22px;
    width: 100%;
    transition: none;
}

.recipes-header,
.news-header,
.chatbot-header,
.private-header,
.public-header {
    border-left: 3px solid #e0e4e8;
    background: none;
}

.list-header:hover {
    background: none;
    color: #1677ff;
}








/* 기존 사이드바 닫기 버튼 (사용하지 않음) */
.sidebar-close-btn {
    display: none !important; /* 완전히 비활성화 */
}

/* 기존 사이드바 닫기 버튼 관련 스타일 모두 비활성화 */

/* 기존 btn-invite 스타일 제거 (더 이상 사용하지 않음) */
.btn-invite {
    display: none;
}

/* 사이드바 바로 옆 고정 닫기 버튼 */
.sidebar-close-btn-fixed {
    position: fixed;
    top: 50%;
    left: 190px; /* 오른쪽으로 30px 이동 */
    transform: translateY(-50%);
    width: 45px;
    height: 80px;
    background: linear-gradient(135deg, #51a380 0%, #428c6a 100%);
    border: none;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    display: none; /* 초기에는 숨김 */
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 12px rgba(81, 163, 128, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1001; /* left-area보다 위에 */
}

.sidebar-close-btn-fixed:hover {
    left: 185px; /* 살짝 왼쪽으로 이동 */
    transform: translateY(-50%) scale(1.05);
    box-shadow: 
        0 6px 20px rgba(81, 163, 128, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-close-btn-fixed svg {
    color: white;
    transition: all 0.3s ease;
}

.sidebar-close-btn-fixed:hover svg {
    transform: scale(1.1);
}




/* 데스크톱에서 닫기 버튼 확실히 숨기기 */
@media (min-width: 769px) {
    .sidebar-close-btn-fixed {
        display: none !important;
    }
}









@media (max-width: 768px) {
    /* 모바일에서 새로운 고정 닫기 버튼 조정 */
    .sidebar-close-btn-fixed {
        left: 190px; /* 오른쪽으로 30px 이동 */
        width: 40px;
        height: 70px;
    }
    
    .sidebar-close-btn-fixed:hover {
        left: 185px;
        transform: translateY(-50%) scale(1.03);
    }
}









.right-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.login-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.right-area-upper {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(81, 163, 128, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: visible;
    padding: 20px 24px;
}

/* 고급스러운 상단 라인 */
.right-area-upper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #51a380 20%, 
        #6bb894 50%, 
        #51a380 80%, 
        transparent 100%);
}

.menu-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 20px;
}

.search-part-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1000;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-right: 20px;
    font-size: 13px;
}

.menu-links {
    text-decoration: none;
    color: #232428;
    margin-right: 20px;
    font-weight: 500;
}

.more-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.more-button:hover {
    background-color: rgba(81, 163, 128, 0.1);
}

.more-button svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.more-button:hover svg {
    transform: scale(1.1);
    stroke: #3d8c6d;
}

.more-menu-list {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 9999;
    padding: 8px 0;
}

.more-menu-list.hide {
    display: none;
}

.more-menu-list li {
    list-style: none;
}

.more-menu-list li a {
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 10px 20px;
}

.more-menu-list li a:hover {
    background-color: rgba(81, 163, 128, 0.05);
}

.btn-notification {
    display: none;
}

.notification-menu {
    display: none;
}

.notification-menu.hide {
    display: none;
}

.notification-menu li {
    display: none;
}

.notification-menu li a {
    display: none;
}

.notification-menu li a:hover {
    display: none;
}

.btn-notification span {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
}

.action-buttons-wrapper {
    display: flex;
    gap: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.action-button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.action-button:first-child {
    background-color: #51a380;
    color: #fff;
    border: 1px solid #51a380;
}

.action-button:last-child {
    background-color: transparent;
    color: #51a380;
    border: 1px solid #51a380;
}

.action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(81, 163, 128, 0.15);
}

.action-button:first-child:hover {
    background-color: #3d8c6d;
    border-color: #3d8c6d;
}

.action-button:last-child:hover {
    background-color: rgba(81, 163, 128, 0.05);
}

.btn-record {
    background: #51a380;
    color: #fff;
}

.btn-upload {
    background: #f5f5f5;
    color: #232428;
}

.content-line {
    margin-bottom: 10px;
}

/* 섹션별 배경색 구분 */
.content-line-hero {
    background: rgba(81, 163, 128, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(81, 163, 128, 0.1);
}

.content-line-list {
    background: rgba(81, 163, 128, 0.08);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(81, 163, 128, 0.15);
    margin-bottom: 15px;
}

.line-header {
    margin-bottom: 10px;
}

.header-text {
    font-size: 18px;
    font-weight: 700;
    color: #51a380;
    text-shadow: 0 1px 2px rgba(81, 163, 128, 0.1);
}

.hero-img-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 400px;
}

.hero-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-text-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
}

.upload-text-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.upload-text-info {
    font-size: 13px;
}

.upload-text-info span {
    margin-left: 10px;
    opacity: 0.8;
}

.video-box-wrapper {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-right: 20px;
    width: 300px;
}

.img-preview {
    height: 180px;
    overflow: hidden;
}

.img-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-description-wrapper {
    padding: 15px;
    position: relative;
}

.video-description-header {
    font-weight: 700;
    margin-bottom: 5px;
}

.video-description-subheader {
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}

.video-description-info {
    font-size: 12px;
    color: #666;
}

.video-description-info span {
    margin-left: 10px;
}

.btn-play {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 30px;
    height: 30px;
    background: #51a380;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.btn-play::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-left: 10px solid #fff;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* 모바일 반응형 스타일 (통합) */
@media (max-width: 768px) {
    /* 앱 래퍼 */
    .app-wrapper {
        flex-direction: column;
    }
    
    /* 좌측 사이드바 */
    .left-area {
        position: fixed;
        left: -190px;
        top: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        background: #fff;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding-bottom: env(safe-area-inset-bottom); /* 아이폰 안전 영역 */
        padding-bottom: 20px; /* 기본 패딩 */
    }
    
    .left-area.hide-on-mobile {
        left: -190px;
    }
    
    .left-area:not(.hide-on-mobile) {
        left: 0;
    }
    
    .menu-button {
        display: block;
    }
    
    /* 기존 close-menu 모바일 스타일 제거됨 */
    
    .right-area {


        width: 100% !important;
        margin-left: 0 !important;
        padding: 20px 3px !important;

    }
    
    .right-area-upper {


        padding: 10px 3px !important;

    }




    .action-buttons {
        display: none;
        gap: 8px;
    }
    
    .action-button {
        padding: 8px 12px;
        font-size: 13px;
    }
    




    .more-menu-list {
        right: 0;
    }


    /* 페이지 콘텐츠 */
    .page-right-content {
        padding: 15px;
    }





    .intro-title {
        font-size: 40px;
    }

    .intro-bg-anim {
        font-size: 120px;
    }

    .intro-bg-anim.top {
        top: 10%;
    }

    .intro-bg-anim.middle {
        top: 40%;
    }

    .intro-bg-anim.bottom {
        top: 70%;
    }

    .language-options {
        min-width: 150px !important;
    }

    /* 카드 레이아웃 최적화 */
    .recipe-card {
        width: 100%;
        margin-bottom: 15px;
    }
    
    /* 모바일에서 섹션 배경 조정 */
    .content-line-hero,
    .content-line-list {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .recipe-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* 검색 폼 최적화 */
    .search-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input {
        width: 100%;
        font-size: 16px; /* iOS에서 줌 방지 */
    }
    
    /* 버튼 터치 영역 확대 */
    button, .btn, a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 터치 스크롤 최적화 */
    .scroll-container {
        -webkit-overflow-scrolling: touch;
    }

}

@media (max-width: 480px) {
    .intro-title {
        font-size: 30px;
    }

    .intro-bg-anim {
        font-size: 100px;
    }

    .language-options {
        min-width: 150px !important;
    }
}

.intro-bg-text {
    position: absolute;
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 160px;
    font-family: 'Cinzel', serif;
    color: #646464;
    opacity: 0.18;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    white-space: nowrap;
}

.intro-bg-text.top { top: 5%; }
.intro-bg-text.middle { top: 50%; transform: translate(-50%, -50%); }
.intro-bg-text.bottom { bottom: 5%; }

.loader marquee { display: none; }

/* Owl Carousel 간격 최적화 */
.owl-carousel .owl-stage-outer {
    padding: 0;
    margin: 0;
}

.owl-carousel .owl-stage {
    padding: 0;
    margin: 0;
}

.owl-carousel .owl-item {
    padding: 0;
    margin: 0;
}

/* Owl nav 버튼 간격 조정 */
.owl-nav {
    margin: 0;
}

.owl-prev, .owl-next {
    margin: 0;
}

.intro-bg-anim {
    position: absolute;
    width: 100vw;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 240px;
    font-family: 'Playfair Display', serif;
    color: rgba(255, 255, 255, 0.15);
    opacity: 0.25;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    white-space: nowrap;
    line-height: 1;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

.intro-bg-anim.top {
    top: 1%;
    animation-name: slide-right;
    animation-duration: 8s;
}

.intro-bg-anim.middle {
    top: 35%;
    transform: translate(-50%, -50%);
    animation-name: slide-left;
    animation-duration: 6s;
}

.intro-bg-anim.bottom {
    top: 65%;
    animation-name: slide-right;
    animation-duration: 10s;
}

@keyframes slide-right {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes slide-left {
    0% { transform: translateX(30%); }
    100% { transform: translateX(-100%); }
}

.language-button {
    width: 150px;
    min-width: 150px;
    max-width: none;
}

.language-options {
    min-width: 150px !important;
}



/* 태블릿 최적화 */
@media (min-width: 769px) and (max-width: 1024px) {
  .left-area {
    width: 200px;
  }
  
  .recipe-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* PWA 설치 프롬프트 스타일 */
.install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #51a380;
  color: white;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  display: none;
}

.install-prompt.show {
  display: block;
}

.install-prompt button {
  background: white;
  color: #51a380;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  margin-left: 10px;
  cursor: pointer;
}
