/* result.css - 결과 영역, 공유 버튼 스타일 */

/* 결과 영역 */
.result-section {
    display: none;
    background: #ffffff;
    border-radius: 20px;
    padding: 25px 20px;
    margin-top: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.5s ease-out;
}

.result-section.show {
    display: block;
}

/* 카드 스타일 결과 (스크린샷 형태) */
.result-section.result-card-style {
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.result-card-container {
    position: relative;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    min-height: 600px;
    border-radius: 30px;
    overflow: hidden;
}

/* CSS 점선 테두리 (SVG 방식으로 둥근 모서리) */
.result-card-container::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    bottom: 30px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 2;
    background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' fill='none' rx='20' ry='20' stroke='white' stroke-width='8' stroke-dasharray='12,12' stroke-dashoffset='0' stroke-linecap='butt'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-position: 0 0;
    background-repeat: no-repeat;
}

/* 배경 레이어들 */
.result-bg-layer,
.result-bgline-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    object-fit: cover;
}

.result-bg-layer {
    z-index: 1;
}

/* CSS 눈 효과 */
.snowflakes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10%;
    width: 20px;
    height: 20px;
    opacity: 0.8;
    animation: snowfall linear infinite;
}

@keyframes snowfall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0.3;
    }
}

/* 각 눈송이에 다른 크기와 위치, 속도 적용 */
.snowflake:nth-child(1) {
    left: 10%;
    width: 24px;
    height: 24px;
    animation-duration: 8s;
    animation-delay: 0s;
}

.snowflake:nth-child(2) {
    left: 20%;
    width: 16px;
    height: 16px;
    animation-duration: 10s;
    animation-delay: 1s;
}

.snowflake:nth-child(3) {
    left: 30%;
    width: 30px;
    height: 30px;
    animation-duration: 7s;
    animation-delay: 2s;
}

.snowflake:nth-child(4) {
    left: 40%;
    width: 20px;
    height: 20px;
    animation-duration: 9s;
    animation-delay: 0.5s;
}

.snowflake:nth-child(5) {
    left: 50%;
    width: 26px;
    height: 26px;
    animation-duration: 11s;
    animation-delay: 1.5s;
}

.snowflake:nth-child(6) {
    left: 60%;
    width: 18px;
    height: 18px;
    animation-duration: 8.5s;
    animation-delay: 2.5s;
}

.snowflake:nth-child(7) {
    left: 70%;
    width: 28px;
    height: 28px;
    animation-duration: 10.5s;
    animation-delay: 0.8s;
}

.snowflake:nth-child(8) {
    left: 80%;
    width: 22px;
    height: 22px;
    animation-duration: 9.5s;
    animation-delay: 1.8s;
}

.snowflake:nth-child(9) {
    left: 90%;
    width: 14px;
    height: 14px;
    animation-duration: 12s;
    animation-delay: 3s;
}

.snowflake:nth-child(10) {
    left: 15%;
    width: 32px;
    height: 32px;
    animation-duration: 7.5s;
    animation-delay: 2.2s;
}

/* 컨텐츠 레이어 */
.result-card-content {
    position: relative;
    z-index: 4;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 25px;
    color: white;
}

/* 상단 타이틀 */
.result-card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    text-align: center;
}

/* 메인 캐릭터 원형 */
.result-char-circle {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 5px solid rgba(0, 60, 120, 0.8);
    overflow: hidden;
}

.result-char-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 타입 라벨 */
.result-type-label {
    background: white;
    color: #003C78;
    font-size: 1.3rem;
    font-weight: 800;
    padding: 12px 35px;
    border-radius: 50px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(0, 60, 120, 0.6);
}

/* 메인 이미지 */
#mainOriginal {
    width: 75%;
    max-width: 400px;
    height: auto;
    object-fit: contain;
    margin: 50px auto 20px;
    display: block;
}

/* 분석 결과 서브타이틀 */
.result-subtitle {
    font-size: 1.3rem;
    font-weight: 500;
    color: white;
    text-align: left;
    margin-top: 15px;
    margin-bottom: 12px;
    width: 75%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
}

/* 분석 결과 박스 (mini 이미지 포함) */
.result-analysis-box {
    position: relative;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(200, 200, 200, 0.4);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 20px;
    width: 75%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.result-mini-char {
    position: absolute;
    top: -40px;
    right: -25px;
    width: 70px;
    height: 70px;
    object-fit: contain;
    z-index: 10;
}

.result-analysis-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    line-height: 1.8;
    color: white;
    padding: 0 12px;
    text-align: left;
    word-break: keep-all;
    word-spacing: 0.05em;
    letter-spacing: -0.02em;
    white-space: pre-line;
}

/* 추천 선물 섹션 */
.result-gifts-section {
    width: 75%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-gifts-section .result-section-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 500;
    text-align: left;
    margin-top: 25px;
    margin-bottom: 20px;
    width: 100%;
}

.result-gifts-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
    padding: 0;
}

.result-gift-item {
    flex: 0 0 auto;
    width: calc(33.333% - 14px);
    min-width: 85px;
    max-width: 105px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-gift-card {
    background: white;
    border: 1px solid #ccc;
    border-radius: 18px;
    padding: 6px;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
}

.gift-card-badge {
    background: transparent;
    color: black;
    font-size: 0.7rem;
    font-weight: 400;
    padding: 4px 10px;
    border-radius: 10px;
    margin-bottom: 8px;
    display: inline-block;
}

.gift-card-image-wrapper {
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gift-emoji {
    font-size: 2.5rem;
    line-height: 1;
}

.gift-item-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: white;
    text-align: center;
    line-height: 1.3;
    word-break: keep-all;
    margin-top: 10px;
}

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

.result-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px dashed #c41e3a;
}

.result-header h2 {
    color: #b01030;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-header p {
    color: #555;
    font-size: 0.95rem;
    font-weight: 500;
}

/* 선물 유형 배지 스타일 */
.gift-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(26, 71, 42, 0.3);
    animation: badgePop 0.5s ease-out;
}

@keyframes badgePop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.gift-type-badge .type-emoji {
    font-size: 1.8rem;
    animation: emojiPulse 2s ease-in-out infinite;
}

@keyframes emojiPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.gift-type-badge .type-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* 유형 캐릭터 이미지 스타일 */
.type-character-container {
    margin-bottom: 15px;
}

.type-character-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    animation: characterBounce 0.6s ease-out;
}

@keyframes characterBounce {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    70% {
        transform: scale(0.95) rotate(-2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* 캐릭터 이미지 호버 효과 */
.type-character-img:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.result-content {
    color: #222;
    line-height: 1.9;
    font-size: 1rem;
}

.result-content h3 {
    color: #1a472a;
    margin: 24px 0 12px;
    font-size: 1.15rem;
    font-weight: 700;
}

.result-content ul {
    padding-left: 20px;
}

.result-content li {
    margin-bottom: 14px;
    position: relative;
    color: #222;
}

.result-content li::marker {
    content: '🎁 ';
}

.result-content strong {
    color: #111;
    font-weight: 700;
}

.result-content em {
    color: #444;
}

/* 다시하기 버튼 */
.reset-btn {
    width: 100%;
    max-width: 540px;
    margin: 20px auto 0;
    display: block;
    padding: 14px;
    background: #2d5a3f;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-btn:hover {
    background: #1a472a;
}

.result-card-style .reset-btn {
    margin-top: 15px;
}

/* 공유하기 버튼 영역 */
.share-section {
    margin-top: 25px;
    padding: 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.result-card-style .share-section {
    margin-top: 20px;
}

.share-title {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn.native {
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 100%);
    color: white;
}

.share-btn.download {
    background: linear-gradient(135deg, #2d5a3f 0%, #1a472a 100%);
    color: white;
}

/* 반응형 디자인 (모바일) */
@media (max-width: 600px) {
    .result-card-container {
        max-width: 100%;
        border-radius: 20px;
    }

    .result-bgline-layer {
        top: 20px;
        left: 20px;
        right: 20px;
        bottom: 20px;
        width: calc(100% - 40px);
        height: calc(100% - 40px);
    }

    .result-card-content {
        padding: 25px 20px;
    }

    .result-card-title {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    .result-char-circle {
        width: 220px;
        height: 220px;
    }

    .result-type-label {
        font-size: 1.1rem;
        padding: 10px 28px;
    }

    .result-analysis-box {
        padding: 15px;
    }

    .result-mini-char {
        width: 45px;
        height: 45px;
    }

    .result-analysis-text {
        font-size: 0.85rem;
        padding: 0 12px 0 8px;
    }

    .result-gifts-row {
        width: 100%;
        padding: 0;
        gap: 12px;
    }

    .result-gift-item {
        width: calc(50% - 6px);
        min-width: 80px;
        max-width: 95px;
    }

    .gift-card-image-wrapper {
        width: 60px;
        height: 60px;
    }

    .result-gift-card {
        width: 100%;
        padding: 10px 8px;
    }

    .gift-card-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    .result-bgline-layer {
        top: 15px;
        left: 15px;
        right: 15px;
        bottom: 15px;
        width: calc(100% - 30px);
        height: calc(100% - 30px);
    }

    .result-char-circle {
        width: 180px;
        height: 180px;
    }

    .result-card-title {
        font-size: 1.2rem;
    }

    .result-type-label {
        font-size: 1rem;
        padding: 8px 24px;
    }

    .result-subtitle {
        font-size: 0.95rem;
    }

    .result-mini-char {
        width: 40px;
        height: 40px;
    }

    .result-analysis-text {
        padding: 0 10px 0 8px;
    }

    .result-gifts-row {
        gap: 10px;
        padding: 0;
        justify-content: center;
    }

    .result-gift-item {
        width: calc(50% - 5px);
        min-width: 75px;
        max-width: 90px;
    }

    .gift-card-image-wrapper {
        width: 55px;
        height: 55px;
    }

    .result-gift-card {
        width: 100%;
        padding: 8px 6px;
    }

    .gift-card-icon {
        font-size: 1.8rem;
    }

    .gift-card-name {
        font-size: 0.75rem;
    }
}

/* 매우 좁은 화면 (300px 이하) - 1개씩 보기 */
@media (max-width: 300px) {
    .result-gifts-row {
        justify-content: center;
    }

    .result-gift-item {
        width: 100%;
        max-width: 100px;
    }

    .gift-card-image-wrapper {
        width: 65px;
        height: 65px;
    }
}

/* ===== 선물 받으실 분의 유형 섹션 ===== */
.result-type-section {
    margin-bottom: 25px;
}

.type-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    border-radius: 20px;
    padding: 25px 20px;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.15);
    border: 2px solid rgba(196, 30, 58, 0.2);
    text-align: center;
    position: relative;
    z-index: 10;
}

.type-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #C41E3A;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.type-desc {
    font-size: 1.1rem;
    color: #555;
    font-style: italic;
    margin-bottom: 15px;
    line-height: 1.6;
}

.type-analysis {
    font-size: 1rem;
    color: #333;
    line-height: 1.8;
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border-left: 4px solid #FFD93D;
}

/* ===== 산타가 가장 추천하는 선물 섹션 ===== */
.result-best-gift-section {
    margin-top: 30px;
    position: relative;
    z-index: 10;
}

.best-gift-card {
    background: linear-gradient(135deg, #FFD93D 0%, #FFC107 100%);
    border-radius: 20px;
    padding: 25px 20px;
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
    border: 3px solid #FFA000;
    position: relative;
    overflow: hidden;
}

.best-gift-card::before {
    content: '⭐';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 6rem;
    opacity: 0.15;
    transform: rotate(15deg);
}

.best-gift-header {
    font-size: 1.3rem;
    font-weight: 700;
    color: #C41E3A;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.5);
}

.best-gift-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: #8B0000;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.3);
}

.best-gift-message {
    font-size: 1rem;
    color: #333;
    line-height: 1.8;
    padding: 15px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 모바일 반응형 */
@media (max-width: 480px) {
    .type-card {
        padding: 20px 15px;
    }

    .type-name {
        font-size: 1.5rem;
    }

    .type-desc {
        font-size: 1rem;
    }

    .type-analysis {
        font-size: 0.9rem;
        padding: 12px;
    }

    .best-gift-card {
        padding: 20px 15px;
    }

    .best-gift-header {
        font-size: 1.1rem;
    }

    .best-gift-name {
        font-size: 1.3rem;
    }

    .best-gift-message {
        font-size: 0.9rem;
        padding: 12px;
    }
}
