/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 20-30대 여성 취향 파스텔 컬러 팔레트 */
    --primary-pink: #FFB6C1;
    --primary-rose: #FFC0CB;
    --primary-lavender: #E6E6FA;
    --primary-peach: #FFDAB9;
    --primary-mint: #B0E0E6;
    --primary-lilac: #DDA0DD;
    --primary-cream: #FFF8DC;
    
    /* 그라데이션 배경 */
    --gradient-1: linear-gradient(135deg, #FFB6C1 0%, #FFC0CB 30%, #E6E6FA 60%, #DDA0DD 100%);
    --gradient-2: linear-gradient(135deg, #FFDAB9 0%, #FFB6C1 40%, #E6E6FA 80%, #FFF8DC 100%);
    --gradient-3: linear-gradient(135deg, #FFE4E1 0%, #FFF0F5 50%, #F0E6FF 100%);
    
    /* 텍스트 컬러 */
    --text-dark: #2D2D2D;
    --text-medium: #5A5A5A;
    --text-light: #8A8A8A;
    
    /* 그림자 */
    --shadow-sm: 0 2px 8px rgba(255, 182, 193, 0.15);
    --shadow-md: 0 4px 16px rgba(255, 182, 193, 0.2);
    --shadow-lg: 0 8px 24px rgba(255, 182, 193, 0.25);
    
    /* 둥근 모서리 */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 40px;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #FFE4E1 0%, #FFF0F5 25%, #F0E6FF 50%, #E6E6FA 75%, #FFE4E1 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    overscroll-behavior-y: none; /* pull-to-refresh(당겨서 새로고침) 방지 */
    position: relative;
    /* 안드로이드 웹뷰 텍스트 크기 자동 조정 방지 */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 192, 203, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(230, 230, 250, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(221, 160, 221, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 10% 80%, rgba(255, 218, 185, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* 전면배너 스타일 */
.top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 20px;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.top-banner.hidden {
    transform: translateY(-100%);
}

.banner-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    cursor: pointer;
    color: var(--text-medium);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.banner-close:hover {
    background: #f0f0f0;
    color: var(--text-dark);
}

.banner-placeholder {
    padding: 8px 16px;
    background: var(--gradient-2);
    border-radius: var(--radius-sm);
    color: var(--text-medium);
    font-size: 14px;
    text-align: center;
}

/* 메인 컨테이너 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    padding-bottom: calc(80px + 70px); /* 하단 고정 배너 높이 고려 */
    min-height: 100vh;
}

/* 헤더 */
.header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.logo {
    font-size: 52px;
    font-weight: 700;
    background: linear-gradient(135deg, #FF69B4 0%, #FF1493 25%, #DA70D6 50%, #9370DB 75%, #BA55D3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
    margin-bottom: 0;
    filter: drop-shadow(0 2px 8px rgba(255, 105, 180, 0.3));
}

/* 새로고침 버튼 */
.refresh-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.2) 0%, rgba(230, 230, 250, 0.2) 100%);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.2);
    padding: 0;
    border: 2px solid rgba(255, 182, 193, 0.4);
    position: relative;
    overflow: hidden;
}

.refresh-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 182, 193, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.refresh-btn:hover::before {
    width: 100%;
    height: 100%;
}

.refresh-btn:hover {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.3) 0%, rgba(230, 230, 250, 0.3) 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.4);
    border-color: rgba(255, 182, 193, 0.6);
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-icon {
    width: 22px;
    height: 22px;
    color: var(--primary-pink);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(255, 182, 193, 0.3));
}

.refresh-btn:hover .refresh-icon {
    transform: rotate(360deg);
    color: #FF69B4;
}

.refresh-btn:active .refresh-icon {
    transform: rotate(360deg) scale(0.9);
}

.logo::after {
    content: '🦹 루팡공작소';
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #FF69B4 0%, #FF1493 25%, #DA70D6 50%, #9370DB 75%, #BA55D3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: -1;
    filter: blur(8px);
    opacity: 0.5;
}

/* 정보 패널 */
.info-panel {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    margin-bottom: 0;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInDown 0.8s ease 0.3s both;
}

.info-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(255, 182, 193, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    flex: 1;
    max-width: 280px;
}

.info-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 182, 193, 0.3);
    background: rgba(255, 255, 255, 1);
}

.info-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 182, 193, 0.3);
}

.info-content {
    flex: 1;
    min-width: 0;
}

.info-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-link {
    text-decoration: none;
    color: var(--text-dark);
    display: block;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.news-link:hover {
    color: var(--primary-pink);
    text-decoration: underline;
}

.news-link:visited {
    color: var(--text-dark);
    text-decoration: none;
}

.news-link:active {
    color: var(--text-dark);
}

.info-date {
    font-size: 12px;
    color: var(--text-medium);
    font-weight: 400;
}

.info-detail {
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 500;
    margin-top: 2px;
}

/* 반응형 */
@media (max-width: 768px) {
    .info-panel {
        flex-direction: column;
        gap: 12px;
        margin-top: 16px;
    }
    
    .info-item {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        padding: 14px 18px;
    }
    
    .info-icon {
        font-size: 28px;
        width: 44px;
        height: 44px;
    }
    
    .info-value {
        font-size: 16px;
    }
}

/* 띠배너 스타일 */
.strip-banner {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px 24px;
    margin: 30px 0;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.strip-banner-content {
    padding: 12px;
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 14px;
}

.strip-banner.bottom {
    margin-top: 50px;
}

.strip-banner.bottom .strip-banner-content {
    width: 320px;
    height: 50px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.strip-banner.bottom .strip-banner-content .kakao_ad_area {
    display: block !important;
}

/* 컨텐츠 그리드 */
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
    animation: fadeInUp 0.6s ease 0.2s both;
    max-width: 100%;
}

/* 컨텐츠 카드 - 타일 형태 */
.content-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(255, 182, 193, 0.15);
    position: relative;
    overflow: hidden;
    border: 1.5px solid rgba(255, 182, 193, 0.2);
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF8F8 100%);
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    -webkit-tap-highlight-color: transparent;
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.content-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 182, 193, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.content-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.3);
    border-color: rgba(255, 182, 193, 0.5);
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF0F5 100%);
}

.content-card:hover::before {
    transform: scaleX(1);
}

.content-card:hover::after {
    opacity: 1;
}

.content-card:active {
    transform: translateY(-4px) scale(1.01);
}

.content-card.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #F5F5F5 0%, #FAFAFA 100%);
}

.content-card.coming-soon:hover {
    transform: none;
    border-color: rgba(255, 182, 193, 0.3);
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.2);
}

.card-icon {
    font-size: 40px;
    margin-bottom: 10px;
    line-height: 1;
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(255, 182, 193, 0.3));
    /* 안드로이드 웹뷰에서 아이콘 크기 유지 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-size: 40px !important;
}

.content-card:hover .card-icon {
    transform: scale(1.2) rotate(8deg);
    filter: drop-shadow(0 4px 8px rgba(255, 182, 193, 0.5));
}

.content-card:nth-child(2) .card-icon {
    animation-delay: 0.2s;
}

.content-card:nth-child(3) .card-icon {
    animation-delay: 0.4s;
}

.content-card:nth-child(4) .card-icon {
    animation-delay: 0.6s;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    line-height: 1.3;
    /* 안드로이드 웹뷰에서 폰트 크기 유지 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-size: 16px !important;
}

.card-desc {
    font-size: 12px;
    color: var(--text-medium);
    font-weight: 400;
    line-height: 1.4;
    opacity: 0.8;
    /* 안드로이드 웹뷰에서 폰트 크기 유지 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-size: 12px !important;
}

/* 즐겨찾기 버튼 */
.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.4);
}

.favorite-btn:active {
    transform: scale(0.95);
}

.favorite-icon {
    font-size: 20px;
    color: #999;
    transition: all 0.3s ease;
    line-height: 1;
    display: block;
    position: relative;
}

.favorite-icon::before {
    content: '☆';
    display: block;
}

.favorite-btn.active .favorite-icon {
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.favorite-btn.active .favorite-icon::before {
    content: '★';
}

/* 애니메이션 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 메인 페이지 하단 고정형 배너 */
.main-fixed-bottom-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 0;
    height: var(--fixed-banner-height, 50px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-bottom-banner-content {
    width: 320px;
    height: 50px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.main-bottom-banner-content .kakao_ad_area {
    display: block !important;
}

/* Onpith CPS 배너 스타일 */
.cps-banner {
    width: 100%;
    max-width: 1200px;
    margin: 16px auto 0;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 컨텐츠 띠배너1번 스타일 */
.content-strip-banner-1 {
    width: 100%;
    max-width: 1200px;
    margin: 8px auto 60px;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.content-strip-banner-1-content {
    width: 320px;
    height: 50px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
}

.content-strip-banner-1-content .kakao_ad_area {
    display: block !important;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 40px 16px 80px;
        padding-bottom: calc(40px + 70px);
    }
    
    .logo-container {
        gap: 8px;
    }
    
    .logo {
        font-size: 36px;
    }
    
    .refresh-btn {
        width: 40px;
        height: 40px;
    }
    
    .refresh-icon {
        width: 20px;
        height: 20px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    /* 모바일: 2열 (기본값과 동일) */
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .content-card {
        padding: 20px 16px;
        min-height: 140px;
    }
    
    .card-icon {
        font-size: 40px !important;
        margin-bottom: 10px;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    .card-title {
        font-size: 16px !important;
        margin-bottom: 6px;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    .card-desc {
        font-size: 12px !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

/* 태블릿 (768px 이상) */
@media (min-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .content-card {
        padding: 24px 20px;
        min-height: 160px;
    }
    
    .card-icon {
        font-size: 44px !important;
        margin-bottom: 12px;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    .card-title {
        font-size: 17px !important;
        margin-bottom: 8px;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    .card-desc {
        font-size: 13px !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

/* 데스크톱 (1024px 이상) */
@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .content-card {
        padding: 28px 24px;
        min-height: 180px;
    }
    
    .card-icon {
        font-size: 48px !important;
        margin-bottom: 14px;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    .card-title {
        font-size: 18px !important;
        margin-bottom: 8px;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    .card-desc {
        font-size: 14px !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

/* 큰 화면 (1200px 이상) */
@media (min-width: 1200px) {
    .content-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;
    }
    
    .content-card {
        padding: 32px 28px;
        min-height: 200px;
    }
}

/* 푸터 스타일 */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 182, 193, 0.2);
    padding: 12px 20px;
    margin-top: 20px;
    margin-bottom: var(--fixed-banner-height, 50px); /* 하단 고정 광고 배너 높이만큼 여백 */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.footer-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-text {
    font-size: 12px;
    color: var(--text-medium);
    margin: 0;
    text-align: center;
}

.footer-link {
    font-size: 12px;
    color: var(--primary-pink);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    display: inline-block;
}

.footer-link:hover {
    color: var(--primary-rose);
    text-decoration: underline;
}

/* 앱 환경: 하단 고정 배너가 없으므로 푸터 하단 여백 제거 */
body.lupin-inapp .footer {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .footer {
        padding: 10px 16px;
        margin-top: 16px;
        min-height: 40px;
    }
    
    .footer-text,
    .footer-link {
        font-size: 11px;
    }
}
