/* ========================================
   NotiPay 반응형 CSS
   Breakpoints: 1024px / 768px / 480px / 360px
   ======================================== */

/* 모바일 메뉴 오픈 시 스크롤 방지 */
body.nav-open {
    overflow: hidden;
}

/* ----------------------------------------
   햄버거 메뉴 버튼
   ---------------------------------------- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* 모바일 헤더 우측 마이페이지/로그인 단축 아이콘 (PC 에선 숨김) */
.mobile-mypage-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,0.12);
    text-decoration: none;
    font-size: 17px;
    margin-right: 6px;
    transition: background .15s;
}
.mobile-mypage-btn:hover { background: rgba(255,255,255,0.22); }
header.sub_header .mobile-mypage-btn {
    color: #1f2a44;
    background: rgba(31,42,68,0.08);
}
header.sub_header .mobile-mypage-btn:hover { background: rgba(31,42,68,0.18); }

/* 모바일 nav 패널 닫기(X) 버튼 — PC 에선 숨김 (모바일 미디어쿼리에서 보이게 함) */
.nav-close { display: none; }
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}
header.sub_header .hamburger span {
    background: #333;
}
/* 메뉴 열린 상태에서 X 아이콘은 항상 흰색 */
.hamburger.active span {
    background: #fff;
}
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 개발자 문서: 제목 흰색 (다른 서브페이지와 통일) */
.developer-section > .container > h2 {
    color: #ffffff;
    border-bottom: none;
}

/* 개발자 문서: 코드 예제 버튼 정렬 */
.developer-section .language-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 15px 0 25px;
}
.developer-section .language-button {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    box-sizing: border-box;
}

/* ========================================
   서브페이지 디자인 강화
   ======================================== */

/* --- 개발자 문서: 데스크탑 상단 여백 (subpage-theme.css의 padding-top:0 오버라이드) --- */
.subpage-theme.developer-page.developer-section {
    padding-top: 140px;
    padding-bottom: 80px;
}

/* --- 이용방법: 그리드 1열 + 타임라인 레이아웃 --- */
.subpage-theme .instruction-steps {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* --- 이용방법: 스텝 아이콘 원형 배지 --- */
.subpage-theme .step {
    position: relative;
    padding: 28px 28px 28px 100px;
    border-left: 4px solid #2f6ce5;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.subpage-theme .step:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(6, 27, 71, 0.18);
}
.subpage-theme .step-icon {
    position: absolute;
    top: 28px;
    left: 24px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #2f6ce5, #3f8dff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(47, 108, 229, 0.35);
}
.subpage-theme .step-number {
    position: absolute;
    top: 32px;
    right: 24px;
    font-size: 42px;
    font-weight: 800;
    color: rgba(47, 108, 229, 0.08);
    line-height: 1;
    pointer-events: none;
}
.subpage-theme .step .step-title {
    color: #244b9d;
    border-bottom: none;
    padding-bottom: 5px;
}

/* --- 비용안내: 아이콘 + 카드 강화 --- */
.pricing-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #2f6ce5, #3f8dff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(47, 108, 229, 0.3);
}
.pricing-item {
    border-top: 4px solid #2f6ce5;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.pricing-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(6, 27, 71, 0.2);
}
.free-trial {
    position: relative;
    border-left: 4px solid #ffc107;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.free-trial:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(6, 27, 71, 0.18);
}
.free-trial .pricing-icon {
    background: linear-gradient(135deg, #ffc107, #ffca2c);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.35);
}

/* --- 개발자 문서: 섹션 아이콘 + Copy 버튼 --- */
.developer-section section h3 i {
    margin-right: 8px;
    color: #2f6ce5;
}
.developer-section section {
    border-top: 3px solid #2f6ce5;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.developer-section section:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(6, 27, 71, 0.15);
}
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #2f6ce5;
    color: #fff;
    padding: 6px 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s ease;
}
.copy-btn:hover {
    background: #1a56c4;
}

/* --- 서브페이지 공통: additional-info 카드 --- */
.subpage-theme .additional-info {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(183, 221, 255, 0.52);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 8px 20px rgba(6, 27, 71, 0.12);
    text-align: center;
    backdrop-filter: blur(3px);
}
.subpage-theme .additional-info p {
    margin: 0;
    color: #333;
}

/* ----------------------------------------
   1024px - 태블릿 가로
   ---------------------------------------- */
@media (max-width: 1024px) {
    /* 히어로 */
    #mainpage .hero .container {
        gap: 20px;
    }
    #mainpage .hero h1 {
        font-size: 56px;
        line-height: 68px;
    }
    #mainpage .hero p {
        font-size: 24px;
        line-height: 36px;
    }
    #mainpage .hero .hero_img {
        width: 380px;
        height: 420px;
    }
    #mainpage .hero {
        padding: 140px 0;
    }

    /* article */
    #mainpage .article .article_img {
        width: 300px;
        height: 300px;
        background-size: 260px;
    }
    #mainpage .article h2 {
        font-size: 26px;
        line-height: 42px;
    }
    #mainpage .article h2 span {
        font-size: 38px;
        margin: 0 0 30px;
    }
}

/* ----------------------------------------
   768px - 태블릿 세로
   ---------------------------------------- */
@media (max-width: 768px) {
    /* 헤더 높이 고정 */
    header {
        height: 60px !important;
    }

    /* 헤더 컨테이너: 로고(좌) + 햄버거(우) 세로 가운데 */
    header > .container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 60px !important;
        padding: 0 15px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* 로고 */
    header .logo {
        width: 90px !important;
        height: auto !important;
        flex-shrink: 0 !important;
        display: block !important;
        line-height: 0 !important;
    }
    header .logo img {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        vertical-align: middle !important;
    }

    /* 햄버거: flex 표시 + 세로 가운데 (flex item이므로 align-items:center 적용) */
    .hamburger {
        display: flex !important;
        flex-shrink: 0 !important;
    }

    /* 모바일 마이페이지 단축 아이콘 */
    .mobile-mypage-btn { display: inline-flex !important; }

    /* 헤더 우측 영역 (햄버거+마이페이지 묶음) */
    header > .container > .mobile-mypage-btn,
    header > .container > .hamburger {
        margin-left: auto;
    }
    header > .container > .mobile-mypage-btn ~ .hamburger {
        margin-left: 0;
    }

    /* nav: 기본 숨김 → .open 시 슬라이드 패널 */
    header nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: #1a2744;
        z-index: 9300;
        padding: 60px 0 100px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
        overflow-y: auto;
        box-sizing: border-box;
    }
    header nav.open {
        display: block;
        animation: nav-slide-in .25s ease-out;
    }
    @keyframes nav-slide-in {
        from { transform: translateX(100%); }
        to   { transform: translateX(0); }
    }

    /* 패널 안 닫기(X) 버튼 */
    .nav-close {
        display: flex !important;
        position: absolute;
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.2);
        color: #fff;
        cursor: pointer;
        font-size: 16px;
        align-items: center;
        justify-content: center;
        transition: background .15s;
        z-index: 10;
    }
    .nav-close:hover { background: rgba(255,255,255,0.22); }
    header nav ul {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding: 0;
    }
    header nav ul li {
        height: auto !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    header nav ul li::before {
        display: none !important;
    }
    header nav ul li a {
        padding: 15px 25px !important;
        line-height: normal !important;
        color: #fff !important;
        font-size: 16px;
    }
    header nav ul li a:hover {
        background: rgba(255,255,255,0.1);
        text-decoration: none;
    }

    /* 로그인/회원가입 - 패널 하단 고정 */
    header .hd_right {
        display: none !important;
        position: fixed;
        bottom: 0;
        right: 0;
        width: 280px;
        z-index: 9310;
        flex-direction: column;
        padding: 15px 25px;
        background: #152035;
        box-sizing: border-box;
    }
    header .hd_right.open {
        display: flex !important;
    }
    header .hd_right a {
        padding: 10px 0;
        text-align: center;
        border: 1px solid rgba(255,255,255,0.2);
        border-radius: 6px;
        color: #fff !important;
        font-size: 14px;
    }
    header .hd_right a:hover {
        background: rgba(255,255,255,0.1);
        text-decoration: none;
    }

    /* 오버레이 — 패널 백그라운드, 클릭 시 닫힘 */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.55);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 9200;
    }
    .nav-overlay.active {
        display: block;
        animation: notify-fade .2s ease-out;
    }

    /* 히어로 */
    #mainpage .hero {
        padding: 100px 0 60px;
    }
    #mainpage .hero .container {
        flex-direction: column;
        text-align: center;
    }
    #mainpage .hero .txt_box {
        padding: 20px 0 0;
    }
    #mainpage .hero h1 {
        font-size: 42px;
        line-height: 54px;
        margin: 0 0 24px;
    }
    #mainpage .hero p {
        font-size: 20px;
        line-height: 32px;
    }
    #mainpage .hero .hero_img {
        width: 280px;
        height: 300px;
        margin: 30px auto 0;
    }

    /* article */
    #mainpage .article {
        padding: 0 0 80px;
    }
    #mainpage .article .article_img {
        width: 260px;
        height: 260px;
        background-size: 220px;
        margin: 0 auto 30px;
    }
    #mainpage .article h2 {
        font-size: 22px;
        line-height: 36px;
    }
    #mainpage .article h2 span {
        font-size: 32px;
        margin: 0 0 20px;
    }

    /* features */
    #mainpage .features {
        padding: 40px 0 120px !important;
    }
    #mainpage .features h2 {
        font-size: 28px;
        line-height: 38px;
        margin: 0 0 30px;
    }
    #mainpage .features h2 span {
        font-size: 18px;
    }

    /* CTA */
    #mainpage .cta {
        padding: 60px 0 80px;
    }
    #mainpage .cta h2 {
        font-size: 28px;
        line-height: 38px;
    }
    #mainpage .cta h2 span {
        font-size: 18px;
    }
    #mainpage .cta .btn_wrap {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    #mainpage .cta .btn_wrap a {
        min-width: 200px;
        width: 80%;
        max-width: 300px;
    }

    /* 푸터 */
    footer .container {
        padding: 30px 20px 20px;
    }
    footer ul {
        text-align: center;
    }
    footer ul li {
        font-size: 13px;
        line-height: 1.6;
    }
    footer .f_logo {
        width: 110px;
    }

    /* 사이드 박스 */
    .side_box {
        bottom: 20px;
        right: 15px;
        gap: 8px;
        padding: 8px 5px;
    }
    .side_box li > * {
        width: 40px;
        height: 40px;
    }
    .side_box li .kakao {
        background-size: 36px;
    }

    /* 서브페이지 공통 - 이용방법 기준 */
    .subpage-theme {
        padding: 100px 0 50px;
    }
    .subpage-theme h2 {
        font-size: 28px;
    }
    .subpage-theme .container {
        width: 90%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* 비용안내: 가로 넘침 방지 */
    .pricing-container {
        flex-direction: column;
        align-items: center;
    }
    .pricing-item {
        width: 100% !important;
        max-width: 100% !important;
        margin: 10px 0 !important;
        box-sizing: border-box;
    }
    .free-trial {
        box-sizing: border-box;
    }

    /* 이용방법 스텝: 모바일 레이아웃 */
    .subpage-theme .step {
        padding: 70px 20px 24px 24px;
    }
    .subpage-theme .step-icon {
        top: 16px;
        left: 20px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .subpage-theme .step-number {
        top: 20px;
        right: 20px;
        left: auto;
        font-size: 32px;
    }

    /* 개발자 문서: 이용방법과 동일한 스타일 */
    .subpage-theme.developer-page.developer-section {
        padding-top: 100px;
        padding-bottom: 50px;
    }
    .developer-section {
        padding-top: 100px;
        padding-bottom: 50px;
    }
    .developer-section pre {
        font-size: 13px;
        overflow-x: auto;
        word-break: break-all;
    }
    .developer-section section > div[style] {
        flex-direction: column !important;
    }

    /* 마이페이지 */
    .content-section .container {
        padding: 20px 15px;
    }
    .expiry-date-display h3 {
        font-size: 20px !important;
        flex-direction: column !important;
    }
    .expiry-date-display .expiry-date-value {
        font-size: 22px !important;
        margin-left: 0 !important;
        margin-top: 5px;
    }

    /* 테이블 반응형 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: 500px;
    }
}

/* ----------------------------------------
   480px - 모바일
   ---------------------------------------- */
@media (max-width: 480px) {
    /* 히어로 */
    #mainpage .hero {
        padding: 80px 0 40px;
    }
    #mainpage .hero h1 {
        font-size: 34px;
        line-height: 44px;
        margin: 0 0 18px;
    }
    #mainpage .hero p {
        font-size: 17px;
        line-height: 28px;
    }
    #mainpage .hero .hero_img {
        width: 220px;
        height: 240px;
        margin: 20px auto 0;
    }

    /* article */
    #mainpage .article .article_img {
        width: 200px;
        height: 200px;
        background-size: 170px;
        border-radius: 30px;
    }
    #mainpage .article h2 {
        font-size: 18px;
        line-height: 30px;
    }
    #mainpage .article h2 span {
        font-size: 26px;
        margin: 0 0 16px;
    }

    /* features */
    #mainpage .features {
        padding: 30px 0 80px !important;
    }
    #mainpage .features h2 {
        font-size: 24px;
        line-height: 34px;
    }
    #mainpage .features h2 span {
        font-size: 16px;
    }
    .feature-item {
        padding: 15px 20px !important;
    }

    /* CTA */
    #mainpage .cta {
        padding: 40px 0 60px;
    }
    #mainpage .cta h2 {
        font-size: 22px;
        line-height: 32px;
        margin: 0 0 20px;
    }
    #mainpage .cta h2 span {
        font-size: 15px;
    }
    #mainpage .cta .btn_wrap a {
        width: 90%;
    }
    #mainpage .cta .btn_wrap a span {
        font-size: 14px;
        padding: 12px 20px;
    }

    /* 푸터 */
    footer ul li {
        font-size: 12px;
        word-break: keep-all;
    }
    footer .copyright {
        font-size: 12px;
    }

    /* 서브페이지 */
    .subpage-theme {
        padding: 80px 0 40px;
    }
    .subpage-theme h2 {
        font-size: 24px;
    }
    .subpage-theme .section-description,
    .subpage-theme > .container > p {
        font-size: 14px;
    }
    /* 개발자 문서 480px */
    .subpage-theme.developer-page.developer-section {
        padding-top: 80px;
        padding-bottom: 40px;
    }
    .developer-section {
        padding-top: 80px;
        padding-bottom: 40px;
    }

    /* 이용방법 스텝 */
    .subpage-theme .step {
        padding: 65px 16px 20px 20px;
    }
    .subpage-theme .step-icon {
        top: 14px;
        left: 16px;
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
    .subpage-theme .step-number {
        top: 16px;
        right: 16px;
        font-size: 28px;
    }
    .step-title {
        font-size: 1.4em;
    }
    .step-description {
        font-size: 1em;
    }

    /* 폼 */
    .form-container {
        margin: 20px 10px !important;
        padding: 20px !important;
    }

    /* 마이페이지 인라인 스타일 오버라이드 */
    .user-info, .dashboard-features {
        padding: 15px !important;
    }

    /* 개발자 */
    .language-button {
        font-size: 13px;
        padding: 8px 12px;
    }
    .developer-section pre {
        font-size: 12px;
        padding: 10px;
    }
    .developer-section pre button {
        font-size: 11px;
        padding: 3px 8px !important;
    }

    /* 구매 */
    .buy-card {
        padding: 30px 20px;
    }
    .buy-description {
        font-size: 15px;
    }
    .free-trial {
        padding: 20px;
    }
    .free-trial h3 {
        font-size: 20px;
    }
}

/* ----------------------------------------
   360px - 소형 모바일
   ---------------------------------------- */
@media (max-width: 360px) {
    #mainpage .hero h1 {
        font-size: 28px;
        line-height: 38px;
    }
    #mainpage .hero p {
        font-size: 15px;
        line-height: 24px;
    }
    #mainpage .hero .hero_img {
        width: 180px;
        height: 200px;
    }

    #mainpage .article h2 {
        font-size: 16px;
        line-height: 26px;
    }
    #mainpage .article h2 span {
        font-size: 22px;
    }

    #mainpage .features h2 {
        font-size: 20px;
    }
    #mainpage .cta h2 {
        font-size: 20px;
    }

    .subpage-theme h2 {
        font-size: 22px;
    }

    footer ul li {
        font-size: 11px;
    }
}
