/* css/base.css — Root, layout, header, tabs, buttons, footer, modals, animations, share */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-pink: #ff6b9d;
    --secondary-pink: #c44569;
    --light-pink: #fff0f5;
    --gradient: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    --shadow: 0 4px 15px rgba(196, 69, 105, 0.2);
    --card-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, #fff0f5 0%, #ffe4ec 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: var(--card-shadow);
}

/* Header */
.header {
    background: var(--gradient);
    color: white;
    text-align: center;
    padding: 25px 20px;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: white;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-btn {
    flex: 1;
    padding: 12px 5px;
    border: none;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn.active {
    color: var(--primary-pink);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 3px;
    background: var(--gradient);
    border-radius: 3px 3px 0 0;
}

/* Main Content */
.tab-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.tab-panel {
    animation: fadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tab-panel.hidden {
    display: none;
}

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

.primary-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 69, 105, 0.3);
}

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

.secondary-btn {
    background: white;
    color: var(--secondary-pink);
    border: 2px solid var(--secondary-pink);
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: var(--secondary-pink);
    color: white;
}

/* Footer */
.footer {
    background: #fafafa;
    text-align: center;
    padding: 20px;
    border-top: 1px solid #eee;
}

.footer p {
    color: #888;
    font-size: 0.85rem;
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 12px 0;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-pink);
}

.footer-copy {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 5px;
}

/* Page Modal */
.page-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.page-modal.hidden {
    display: none;
}

.page-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px 25px;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.page-modal-close {
    position: sticky;
    top: 0;
    float: right;
    background: #f0f0f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background 0.2s;
}

.page-modal-close:hover {
    background: var(--primary-pink);
    color: white;
}

.page-modal-content h2 {
    color: var(--secondary-pink);
    font-size: 1.4rem;
    margin-bottom: 5px;
    padding-right: 40px;
}

.page-modal-content h3 {
    color: var(--secondary-pink);
    font-size: 1.05rem;
    margin: 20px 0 10px;
}

.page-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.page-modal-content p {
    color: #555;
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 10px;
}

.page-modal-content ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.page-modal-content li {
    color: #555;
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 8px;
}

.page-modal-content a {
    color: var(--primary-pink);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.contact-item {
    padding: 15px;
    background: var(--light-pink);
    border-radius: 12px;
}

.contact-item strong {
    color: var(--secondary-pink);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 4px;
}

.contact-item p {
    margin: 0;
}

/* Result Animation */
@keyframes resultReveal {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes emojiPop {
    0% { transform: scale(0) rotate(-180deg); }
    50% { transform: scale(1.3) rotate(10deg); }
    70% { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1) rotate(0); }
}

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

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

.result-card.animated {
    animation: resultReveal 0.6s ease-out;
}

.result-card.animated .result-emoji {
    animation: emojiPop 0.8s ease-out 0.2s both;
}

.result-card.animated .result-type {
    animation: textSlideUp 0.5s ease-out 0.5s both;
}

.result-card.animated .result-type-korean {
    animation: textSlideUp 0.5s ease-out 0.6s both;
}

.result-card.animated .result-description {
    animation: textSlideUp 0.5s ease-out 0.7s both;
}

.result-card.animated .recommended-products {
    animation: textSlideUp 0.5s ease-out 0.9s both;
}

.result-card.animated .secondary-btn {
    animation: textSlideUp 0.5s ease-out 1.1s both;
}

/* Confetti Effect */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-pink);
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========== SNS Share Buttons ========== */
.share-section {
    border-top: 1px solid #eee;
    margin-top: 24px;
    padding-top: 20px;
    text-align: center;
}

.share-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
    font-weight: 600;
}

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

.share-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

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

.share-btn-x {
    background: #000;
}

.share-btn-fb {
    background: #1877F2;
}

.share-btn-copy {
    background: #6c757d;
}

.share-btn-native {
    background: var(--primary-pink);
}

/* Share Toast */
.share-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.85rem;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.share-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
