/* Custom Styles for Happy Mobile Calculator */

:root {
    --primary-pink: #ec4899;
    --primary-purple: #9333ea;
    --secondary-yellow: #fbbf24;
    --success-green: #10b981;
    --gray-light: #f3f4f6;
}

* {
    font-family: 'Noto Sans KR', sans-serif;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Family Member Cards */
.family-member-card {
    animation: fadeIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.family-member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Input Styles */
input[type="text"],
input[type="number"] {
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

/* Button Hover Effects */
button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

/* Card Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Number Animation */
.number-animate {
    display: inline-block;
    animation: pulse 2s infinite;
}

/* Suggestion Cards */
.suggestion-card {
    animation: slideIn 0.5s ease-out;
    animation-fill-mode: both;
}

.suggestion-card:nth-child(1) { animation-delay: 0.1s; }
.suggestion-card:nth-child(2) { animation-delay: 0.2s; }
.suggestion-card:nth-child(3) { animation-delay: 0.3s; }
.suggestion-card:nth-child(4) { animation-delay: 0.4s; }
.suggestion-card:nth-child(5) { animation-delay: 0.5s; }
.suggestion-card:nth-child(6) { animation-delay: 0.6s; }

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-pink), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Chart Container */
.chart-container {
    position: relative;
    padding: 20px;
    background: white;
    border-radius: 15px;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--gray-light);
    border-top: 3px solid var(--primary-pink);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .family-member-card {
        padding: 12px;
    }
    
    /* Touch-friendly button sizes */
    button {
        font-size: 14px;
        padding: 12px;
        min-height: 44px; /* iOS minimum touch target */
    }
    
    /* Input touch optimization */
    input[type="text"],
    input[type="number"],
    select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    /* Chart container optimization */
    .chart-container {
        padding: 10px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Stack buttons on very small screens */
    .flex-row {
        flex-direction: column;
    }
    
    /* Optimize card spacing */
    .family-member-card {
        padding: 10px;
    }
    
    /* Smaller text for space efficiency */
    .text-xs {
        font-size: 0.7rem;
    }
}

/* Print Styles */
@media print {
    header, footer {
        display: none;
    }
    
    .bg-gradient-to-br {
        background: white !important;
    }
    
    button {
        display: none;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-pink), var(--primary-purple));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
}