/**
 * VPet Game - Stylesheet
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Login Container */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.login-container h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
}

.login-container p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.hint {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-top: 20px;
}

/* Game Container */
#game-container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

header h1 {
    color: #667eea;
}

.username {
    font-weight: bold;
    color: #333;
}

.btn-secondary {
    padding: 8px 20px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

/* Pet Display */
.pet-container {
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.sprite-wrapper {
    text-align: center;
    margin-bottom: 30px;
}

.pet-sprite {
    font-size: 150px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.pet-sprite:hover {
    transform: scale(1.1);
}

#evolutionName {
    font-size: 24px;
    color: #333;
    margin-top: 15px;
}

.stage-indicator {
    color: #888;
    font-size: 16px;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-bar {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
}

.stat-label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.progress-bar {
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.5s ease, background-color 0.3s;
}

.stat-bar[data-stat="food"] .progress-fill {
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
}

.stat-bar[data-stat="comfort"] .progress-fill {
    background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
}

.stat-bar[data-stat="happiness"] .progress-fill {
    background: linear-gradient(90deg, #f472b6 0%, #ec4899 100%);
}

.stat-bar.danger[data-stat="baldness"] .progress-fill {
    background: linear-gradient(90deg, #fb923c 0%, #f97316 100%);
}

.stat-value {
    display: block;
    text-align: right;
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Actions Container */
.actions-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.action-btn {
    padding: 15px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.btn-evolve {
    grid-column: span 3;
    padding: 20px;
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
    color: #065f46;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-evolve:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(167, 243, 208, 0.4);
}

/* Leaderboard */
#leaderboard-container {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#leaderboard-container h2 {
    color: #667eea;
    margin-bottom: 15px;
}

#leaderboardTable {
    width: 100%;
    border-collapse: collapse;
}

#leaderboardTable th,
#leaderboardTable td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#leaderboardTable th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.sprite-small {
    font-size: 24px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.success-modal {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.success-content h3 {
    color: #065f46;
}

/* Responsive */
@media (max-width: 600px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .actions-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-evolve {
        grid-column: span 2;
    }
}

/* Cooldown Bar */
#cooldownBar {
    height: 8px;
    background: #4caf50;
    border-radius: 4px;
    margin-top: 8px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

#cooldownText {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 4px;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.message-area {
    text-align: center;
    padding: 10px;
    min-height: 20px;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}