/**
 * Fishing Game - Frontend Styles
 */

/* Container principale */
.fishing-game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header con statistiche */
.fishing-game-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.fg-user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.fg-stat-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.fg-stat-label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.fg-stat-value {
    display: block;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
}

/* Area di gioco */
.fishing-game-main {
    background: #f7fafc;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Scena del mare */
.fishing-scene {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 30px;
    border-radius: 15px;
    overflow: hidden;
}

.fishing-water {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #4facfe 0%, #00f2fe 40%, #1e3799 100%);
}

.water-surface {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(135, 206, 250, 0.6), transparent);
    animation: water-shimmer 3s ease-in-out infinite;
}

@keyframes water-shimmer {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.8; }
}

.water-waves {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    height: 50px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 100"><path d="M0 50 Q 150 20, 300 50 T 600 50 T 900 50 T 1200 50 L 1200 100 L 0 100 Z" fill="rgba(255,255,255,0.1)"/></svg>') repeat-x;
    animation: wave-motion 8s linear infinite;
}

@keyframes wave-motion {
    0% { background-position: 0 0; }
    100% { background-position: 1200px 0; }
}

/* Canna da pesca */
.fishing-rod {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 60px;
    background: #8b4513;
    border-radius: 2px;
    z-index: 10;
}

.rod-line {
    position: absolute;
    top: 60px;
    left: 50%;
    width: 2px;
    height: 0;
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(-50%);
    transition: height 0.5s ease;
}

.rod-hook {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    transition: top 0.5s ease;
}

.fishing-rod.casting .rod-line {
    height: 180px;
}

.fishing-rod.casting .rod-hook {
    top: 240px;
    animation: hook-swing 2s ease-in-out infinite;
}

@keyframes hook-swing {
    0%, 100% { transform: translateX(-50%) rotate(-5deg); }
    50% { transform: translateX(-50%) rotate(5deg); }
}

/* Bolle d'acqua */
.water-bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.water-bubbles::before,
.water-bubbles::after {
    content: '○';
    position: absolute;
    color: rgba(255, 255, 255, 0.3);
    animation: bubble-rise 6s linear infinite;
}

.water-bubbles::before {
    left: 20%;
    animation-delay: 0s;
}

.water-bubbles::after {
    left: 80%;
    animation-delay: 3s;
}

@keyframes bubble-rise {
    0% {
        bottom: -20px;
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        bottom: 100%;
        opacity: 0;
    }
}

/* Splash */
.fishing-splash {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    animation: splash-effect 0.5s ease-out;
}

@keyframes splash-effect {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Pesci che nuotano */
.swimming-fish {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.swimming-fish .fish {
    position: absolute;
    font-size: 32px;
    opacity: 0.7;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.fish-1 {
    top: 30%;
    animation: swim-left-to-right 12s linear infinite;
    transform: scaleX(-1);
}

.fish-2 {
    top: 50%;
    animation: swim-right-to-left 15s linear infinite;
    animation-delay: -3s;
}

.fish-3 {
    top: 70%;
    animation: swim-left-to-right 18s linear infinite;
    animation-delay: -6s;
    font-size: 24px;
    transform: scaleX(-1);
}

.fish-4 {
    top: 40%;
    animation: swim-right-to-left 14s linear infinite;
    animation-delay: -8s;
    font-size: 28px;
}

.fish-5 {
    top: 60%;
    animation: swim-left-to-right 16s linear infinite;
    animation-delay: -4s;
    font-size: 30px;
    transform: scaleX(-1);
}

.fish-6 {
    top: 80%;
    animation: swim-right-to-left 20s linear infinite;
    animation-delay: -10s;
    font-size: 40px;
    opacity: 0.5;
}

@keyframes swim-left-to-right {
    0% {
        left: -10%;
    }
    100% {
        left: 110%;
    }
}

@keyframes swim-right-to-left {
    0% {
        left: 110%;
    }
    100% {
        left: -10%;
    }
}

/* Stato pesca */
.fishing-status {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s;
}

.fishing-status.active {
    opacity: 1;
}

/* Controlli */
.fishing-controls {
    text-align: center;
}

.fishing-cast-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 18px 50px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.fishing-cast-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.fishing-cast-btn:active:not(:disabled) {
    transform: translateY(0);
}

.fishing-cast-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fishing-cast-btn.casting {
    animation: btn-pulse 2s ease-in-out infinite;
}

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

.btn-icon {
    font-size: 28px;
}

.fishing-remaining {
    margin-top: 15px;
    color: #718096;
    font-size: 14px;
}

/* Risultato pescata */
.fishing-result {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fade-in 0.3s;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.result-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slide-up 0.5s ease;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-icon {
    font-size: 100px;
    margin-bottom: 20px;
    animation: icon-bounce 0.6s ease;
}

@keyframes icon-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.result-name {
    font-size: 32px;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 10px;
}

.result-rarity {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
}

.result-rarity.rarity-common { background: #e2e8f0; color: #4a5568; }
.result-rarity.rarity-uncommon { background: #c6f6d5; color: #22543d; }
.result-rarity.rarity-rare { background: #bee3f8; color: #2c5282; }
.result-rarity.rarity-epic { background: #e9d8fd; color: #553c9a; }
.result-rarity.rarity-legendary { background: #fed7d7; color: #742a2a; }
.result-rarity.rarity-empty { background: #f7fafc; color: #718096; }

.result-weight {
    font-size: 20px;
    color: #4a5568;
    margin-bottom: 15px;
}

.result-points {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 25px;
}

.result-close {
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 40px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.result-close:hover {
    background: #5a67d8;
}

/* Notifica premio */
.fishing-reward-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    animation: fade-in 0.3s;
}

.reward-card {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    max-width: 500px;
    color: #fff;
    animation: slide-up 0.5s ease;
}

.reward-card h3 {
    font-size: 36px;
    margin-bottom: 20px;
}

.reward-card p {
    font-size: 18px;
    margin-bottom: 25px;
}

.reward-coupon {
    background: rgba(255, 255, 255, 0.2);
    border: 2px dashed #fff;
    border-radius: 10px;
    padding: 20px;
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 25px;
}

.reward-close {
    background: #fff;
    color: #19547b;
    border: none;
    border-radius: 10px;
    padding: 12px 40px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
}

.reward-close:hover {
    transform: scale(1.05);
}

/* Tabs */
.fishing-game-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.fg-tab {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.fg-tab:hover {
    color: #667eea;
}

.fg-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

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

.fg-tab-panel.active {
    display: block;
    animation: fade-in 0.3s;
}

/* Lista catture recenti */
.recent-catches-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.catch-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    border-left: 4px solid;
    align-items: center;
}

.catch-item.rarity-common { border-left-color: #cbd5e0; }
.catch-item.rarity-uncommon { border-left-color: #68d391; }
.catch-item.rarity-rare { border-left-color: #4299e1; }
.catch-item.rarity-epic { border-left-color: #9f7aea; }
.catch-item.rarity-legendary { border-left-color: #f56565; }

.catch-name {
    font-weight: bold;
    color: #2d3748;
}

.catch-weight,
.catch-points {
    color: #718096;
}

.catch-time {
    color: #a0aec0;
    font-size: 14px;
}

.no-catches {
    text-align: center;
    color: #a0aec0;
    padding: 40px;
}

/* Classifica */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 60px 2fr 1fr 1fr;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    align-items: center;
}

.leaderboard-item.current-user {
    background: #ebf4ff;
    border: 2px solid #667eea;
}

.lb-position {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    text-align: center;
}

.lb-name {
    font-weight: 600;
    color: #2d3748;
}

.lb-catches,
.lb-points {
    color: #718096;
}

/* Collezione */
.collection-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.collection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    border-left: 4px solid;
}

.collection-item.rarity-common { border-left-color: #cbd5e0; }
.collection-item.rarity-uncommon { border-left-color: #68d391; }
.collection-item.rarity-rare { border-left-color: #4299e1; }
.collection-item.rarity-epic { border-left-color: #9f7aea; }
.collection-item.rarity-legendary { border-left-color: #f56565; }

.collection-rarity {
    font-weight: 600;
    color: #2d3748;
}

.collection-count {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.no-collection {
    text-align: center;
    color: #a0aec0;
    padding: 40px;
}

/* Login richiesto */
.fishing-game-login-required {
    text-align: center;
    padding: 60px 20px;
    background: #f7fafc;
    border-radius: 15px;
    font-size: 18px;
    color: #4a5568;
}

.fishing-game-login-required a {
    color: #667eea;
    font-weight: bold;
    text-decoration: none;
}

.fishing-game-login-required a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .fg-user-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .fishing-scene {
        height: 300px;
    }
    
    .catch-item,
    .leaderboard-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .fishing-cast-btn {
        padding: 15px 35px;
        font-size: 18px;
    }
}
