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

body {
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, #fce4ec 0%, #e3f2fd 50%, #f3e5f5 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    font-size: 2.5em;
    color: #e91e63;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 25px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 15px;
    font-size: 1.1em;
    cursor: pointer;
    background: #f0f0f0;
    color: #666;
    transition: all 0.3s;
    font-family: inherit;
}

.tab-btn.active {
    background: linear-gradient(135deg, #e91e63, #ff5722);
    color: white;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 1em;
    color: #555;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 1.1em;
    font-family: inherit;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #e91e63;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    font-size: 1.1em;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #e91e63, #ff5722);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Messages */
.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.95em;
}

.message.error {
    background: #ffebee;
    color: #c62828;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Header */
.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.username {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

.total-points {
    font-size: 1.1em;
    color: #ff9800;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-size: 1em;
    padding: 8px 15px;
    border-radius: 10px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: #f0f0f0;
    color: #333;
}

/* Home Content */
.home-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Pet Area */
.pet-area {
    background: white;
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center;
}

/* Multi-pet row */
.active-pets-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.pet-card {
    cursor: pointer;
    padding: 15px;
    border-radius: 20px;
    transition: all 0.3s;
    position: relative;
    background: #fafafa;
    min-width: 120px;
}

.pet-card:hover {
    background: #fff9c4;
}

/* Main pet (first/primary) */
.pet-card.main-pet {
    padding: 20px;
    min-width: 160px;
}

/* Side pets */
.pet-card.side-pet {
    opacity: 0.9;
}

/* Growth stages - main pet */
.pet-card.main-pet.baby .pet-emoji-main {
    font-size: 4em;
}
.pet-card.main-pet.young .pet-emoji-main {
    font-size: 5em;
    filter: drop-shadow(0 0 10px rgba(255, 152, 0, 0.3));
}
.pet-card.main-pet.teen .pet-emoji-main {
    font-size: 6em;
    filter: drop-shadow(0 0 15px rgba(233, 30, 99, 0.4));
}
.pet-card.main-pet.adult .pet-emoji-main {
    font-size: 7em;
    filter: drop-shadow(0 0 20px rgba(156, 39, 176, 0.5));
    animation: glow 2s ease-in-out infinite;
}
.pet-card.main-pet.legend .pet-emoji-main {
    font-size: 8em;
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.6));
    animation: legendGlow 1.5s ease-in-out infinite;
}

/* Growth stages - side pets (smaller) */
.pet-card.side-pet.baby .pet-emoji-main { font-size: 2.5em; }
.pet-card.side-pet.young .pet-emoji-main {
    font-size: 3em;
    filter: drop-shadow(0 0 6px rgba(255, 152, 0, 0.3));
}
.pet-card.side-pet.teen .pet-emoji-main {
    font-size: 3.5em;
    filter: drop-shadow(0 0 8px rgba(233, 30, 99, 0.4));
}
.pet-card.side-pet.adult .pet-emoji-main {
    font-size: 4em;
    filter: drop-shadow(0 0 10px rgba(156, 39, 176, 0.5));
}
.pet-card.side-pet.legend .pet-emoji-main {
    font-size: 4.5em;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.6));
}

.pet-emoji-main {
    font-size: 5em;
    transition: all 0.3s;
}

.pet-card .pet-name-main {
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 8px;
    color: #333;
}

.pet-card.main-pet .pet-name-main {
    font-size: 1.5em;
}

.pet-card .pet-level {
    font-size: 1.1em;
    color: #e91e63;
    font-weight: bold;
    margin-top: 3px;
}

.pet-card .growth-stage {
    font-size: 0.85em;
    color: #9c27b0;
    margin-top: 3px;
}

.pet-card .exp-bar-container {
    margin-top: 10px;
}

.pet-card .exp-bar {
    height: 12px;
}

/* Exp Bar */
.exp-bar-container {
    margin-top: 20px;
}

.exp-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.exp-fill {
    height: 100%;
    background: linear-gradient(90deg, #e91e63, #ff5722, #ff9800);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.exp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

.exp-text {
    text-align: center;
    margin-top: 8px;
    font-size: 0.9em;
    color: #666;
}

.today-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.95em;
    color: #666;
}

/* Voice chat area with pet selector */
.voice-chat-area {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.voice-pet-select {
    padding: 10px 15px;
    border: 2px solid #e91e63;
    border-radius: 12px;
    font-size: 1em;
    background: white;
    color: #333;
    cursor: pointer;
    outline: none;
}

.voice-pet-select:focus {
    border-color: #ff5722;
}

.voice-chat-btn {
    display: inline-block;
    text-align: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e91e63, #ff5722);
    color: white;
    text-decoration: none;
    border-radius: 15px;
    font-size: 1.05em;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(233, 30, 99, 0.3);
}

.voice-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.4);
}

/* Tasks Area */
.tasks-area {
    background: white;
    border-radius: 25px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-height: 80vh;
    overflow-y: auto;
}

.tasks-area::-webkit-scrollbar {
    width: 6px;
}

.tasks-area::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

.tasks-area h2 {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 15px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-category {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-category-header {
    font-size: 1em;
    font-weight: bold;
    color: #e91e63;
    padding: 8px 12px;
    background: linear-gradient(90deg, #fce4ec, transparent);
    border-radius: 10px;
    margin-bottom: 2px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f9f9f9;
    border-radius: 15px;
    transition: all 0.3s;
}

.task-item:hover {
    background: #f0f0f0;
}

.task-item.completed {
    background: #e8f5e9;
    opacity: 0.7;
}

.task-emoji {
    font-size: 1.5em;
}

.task-name {
    flex: 1;
    font-size: 1.05em;
}

.task-points {
    color: #ff9800;
    font-weight: bold;
    font-size: 0.95em;
}

.task-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95em;
    transition: all 0.3s;
}

.task-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.task-done {
    font-size: 1.3em;
}

/* Pet Select Page */
.header {
    text-align: center;
    margin-bottom: 25px;
}

.header h1 {
    font-size: 2em;
    color: #e91e63;
}

.back-link {
    display: inline-block;
    margin-bottom: 15px;
    text-decoration: none;
    color: #666;
    font-size: 1em;
}

.back-link:hover {
    color: #e91e63;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 1em;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #e91e63;
}

.filter-btn.active {
    background: #e91e63;
    color: white;
    border-color: #e91e63;
}

/* Pet Grid */
.pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.pet-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 3px solid transparent;
}

.pet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.pet-card.common {
    border-color: #e0e0e0;
}

.pet-card.rare {
    border-color: #2196F3;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.pet-card.legend {
    border-color: #FFD700;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    animation: legendShine 2s ease-in-out infinite;
}

.pet-card .pet-emoji {
    font-size: 3em;
    margin-bottom: 8px;
}

.pet-card .pet-name {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
}

.pet-card .pet-rarity {
    font-size: 0.85em;
}

/* Dialog */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog-box {
    background: white;
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    max-width: 350px;
    width: 90%;
    animation: dialogPop 0.3s ease;
}

.dialog-emoji {
    font-size: 5em;
    margin-bottom: 15px;
}

.dialog-box h2 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 10px;
}

.dialog-box p {
    color: #666;
    margin-bottom: 10px;
}

.rarity {
    font-weight: bold;
    margin-bottom: 20px !important;
}

.dialog-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* My Pets Page */
.my-pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.my-pet-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;
    border: 3px solid transparent;
}

.my-pet-card:hover {
    transform: translateY(-3px);
}

.my-pet-card.active {
    border-color: #e91e63;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2);
}

.my-pet-card .pet-emoji {
    font-size: 3em;
    margin-bottom: 10px;
}

.my-pet-card .pet-name {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
}

.my-pet-card .pet-level {
    font-size: 1em;
    color: #e91e63;
}

.my-pet-card .pet-stage {
    font-size: 0.85em;
    color: #9c27b0;
}

.active-check {
    margin-top: 8px;
    font-size: 1.2em;
}

.adopt-new-card {
    border: 3px dashed #ccc;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #999;
    transition: all 0.3s;
}

.adopt-new-card:hover {
    border-color: #e91e63;
    color: #e91e63;
    background: #fce4ec;
    transform: translateY(-3px);
}

.sub-hint {
    text-align: center;
    color: #999;
    font-size: 0.9em;
    margin-top: 5px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

/* Level Up Overlay */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.level-up-content {
    text-align: center;
    animation: levelUpPop 0.5s ease;
}

.level-up-text {
    font-size: 3em;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 20px;
}

.level-up-level {
    font-size: 4em;
    color: white;
    font-weight: bold;
    text-shadow: 0 0 30px rgba(233, 30, 99, 0.5);
    margin-bottom: 20px;
}

.level-up-emoji {
    font-size: 8em;
    animation: levelUpBounce 0.5s ease;
}

#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2001;
}

/* Particles */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.particle {
    position: absolute;
    pointer-events: none;
    animation: particleFall 1s ease forwards;
}

/* Pet Click Animations */
.pet-bounce {
    animation: petBounce 0.5s ease;
}

.pet-spin {
    animation: petSpin 0.6s ease;
}

.pet-shake {
    animation: petShake 0.5s ease;
}

.pet-pulse {
    animation: petPulse 0.5s ease;
}

.pet-grow-shrink {
    animation: petGrowShrink 0.5s ease;
}

/* Keyframes */
@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 15px rgba(156, 39, 176, 0.3)); }
    50% { filter: drop-shadow(0 0 25px rgba(156, 39, 176, 0.6)); }
}

@keyframes legendGlow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4)); }
    50% { filter: drop-shadow(0 0 35px rgba(255, 215, 0, 0.8)); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes legendShine {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.6); }
}

@keyframes dialogPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

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

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

@keyframes petBounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-30px); }
    50% { transform: translateY(0); }
    70% { transform: translateY(-15px); }
}

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

@keyframes petShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-15px); }
    40% { transform: translateX(15px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

@keyframes petPulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.2); filter: brightness(1.5); }
    100% { transform: scale(1); filter: brightness(1); }
}

@keyframes petGrowShrink {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

@keyframes particleFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100px) rotate(720deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .home-content {
        grid-template-columns: 1fr;
    }

    .pet-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .home-header {
        flex-direction: column;
        gap: 10px;
    }
}
