/* ===================================
   FISHING PANEL
   Панель рыбалки
   =================================== */

/* ===================================
   BASE PANEL
   =================================== */

.fishing-compact-panel {
    padding: var(--spacing-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fishing-compact-panel .panel-content {
    height: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    display: flex;
    flex-direction: column;
}

.fishing-compact-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.fishing-compact-panel .panel-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

/* ===================================
   FISHING AREA
   =================================== */

.fishing-compact-panel .fishing-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.fishing-compact-panel .fishing-location {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
}

.fishing-compact-panel .fishing-rod-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

/* ===================================
   ROD SPRITE & ANIMATIONS
   =================================== */

.fishing-compact-panel .rod-sprite {
    font-size: 48px;
    transition: transform var(--transition-slow);
}

.fishing-compact-panel .rod-sprite.casting {
    transform: rotate(-15deg);
    animation: cast 2s ease-in-out;
}

.fishing-compact-panel .rod-sprite.waiting {
    animation: bob 1.5s ease-in-out infinite;
}

.fishing-compact-panel .rod-sprite.biting {
    animation: bite-alert 0.3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px #ff6b35);
}

.fishing-compact-panel .rod-sprite.catching {
    transform: rotate(15deg);
    animation: catch 1s ease-in-out;
}

.fishing-compact-panel .rod-sprite.failed {
    animation: fail-shake 0.5s ease-in-out;
}

/* ===================================
   FISHING BUTTON
   =================================== */

.fishing-compact-panel .fishing-btn {
    padding: var(--spacing-md) 24px;
    background: linear-gradient(45deg, var(--color-success), #81C784);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid var(--glass-border);
}

.fishing-compact-panel .fishing-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.fishing-compact-panel .fishing-btn:disabled {
    background: var(--glass-bg);
    color: var(--text-disabled);
    cursor: not-allowed;
}

/* ===================================
   ADVANCED FISHING SCENE
   =================================== */

/* Fishing Scene - главная область рыбалки */
.fishing-scene {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(135, 206, 235, 0.3) 0%,
        rgba(70, 130, 180, 0.4) 50%,
        rgba(25, 25, 112, 0.5) 100%);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 400px;
}

/* Water Animation */
.water-layer {
    position: absolute;
    bottom: -20px;
    width: 100%;
    height: 150px;
    background: linear-gradient(180deg,
        rgba(34, 85, 120, 0.7) 0%,
        rgba(20, 60, 95, 0.9) 100%);
    animation: waterWave 3s ease-in-out infinite;
}

/* Pet Character */
.fishing-pet {
    position: absolute;
    bottom: 150px;
    left: 5px;
    width: 100px;
    height: 120px;
    z-index: 5;
}

.pet-sprite {
    font-size: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Fishing Platform */
.fishing-platform {
    position: absolute;
    bottom: 100px;
    left: 0px;
    width: 140px;
    height: 50px;
    background: linear-gradient(180deg, #8B4513 0%, #654321 100%);
    border-radius: 8px;
    z-index: 4;
}

/* Fish Shadows */
.fish-shadow {
    position: absolute;
    bottom: 40px;
    width: 40px;
    height: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    animation: fishSwim 4s ease-in-out infinite;
    z-index: 2;
}

/* Water Ripples */
.water-ripple {
    position: absolute;
    bottom: 60px;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translateX(-50%);
    opacity: 0;
    z-index: 6;
    display: none;
}

/* Fishing Rod */
.fishing-rod {
    position: absolute;
    bottom: 155px;
    left: 90px;
    width: 100px;
    height: 160px;
    z-index: 6;
}

.rod-sprite {
    width: 100%;
    height: 100%;
    background-image: url('../../assets/images/rod_basic.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: rotate(-15deg);
    transform-origin: 8% 88%;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    font-size: 0; /* Hide emoji text */
}

/* Rod State Classes */
.rod-sprite.idle {
    animation: rodIdle 2s ease-in-out infinite;
}

.rod-sprite.casting {
    animation: rodCast 0.8s ease-in-out forwards;
}

.rod-sprite.waiting {
    animation: rodWaiting 3s ease-in-out infinite;
}

.rod-sprite.biting {
    animation: rodBite 2s ease-in-out infinite;
}

.rod-sprite.pre-catching {
    transform: rotate(15deg) translate(-14px, 8px);
    animation: none;
    transition: transform 2s cubic-bezier(0.23, 1, 0.32, 1);
}

.rod-sprite.catching {
    transform: rotate(-15deg) translate(2px, 3px);
    transition: transform 2s cubic-bezier(0.23, 1, 0.32, 1);
}

.rod-sprite.returning {
    animation: rodReturn 1s ease-in-out forwards;
}

/* Rod Keyframes */
@keyframes rodIdle {
    0%, 100% { transform: rotate(-15deg) translate(2px, 3px); }
    50% { transform: rotate(-17deg) translate(2px, 3px); }
}

@keyframes rodCast {
    0% { transform: rotate(-15deg) translate(0px, 3px); }
    50% { transform: rotate(-5deg) translate(0px, 3px); }
    100% { transform: rotate(15deg) translate(-14px, 8px); }
}

@keyframes rodWaiting {
    0%, 100% { transform: rotate(15deg) translate(-14px, 8px); }
    50% { transform: rotate(12deg) translate(-14px, 8px); }
}

@keyframes rodBite {
    0%, 100% { transform: rotate(15deg) translate(-14px, 8px); }
    25% { transform: rotate(20deg) translate(-14px, 8px); }
    75% { transform: rotate(10deg) translate(-14px, 8px); }
}

@keyframes rodCatch {
    0% { transform: rotate(15deg) translate(-14px, 8px); }
    100% { transform: rotate(-25deg) translate(28px, -16px); }
}

@keyframes rodReturn {
    0% { transform: rotate(-25deg) translate(28px, -16px); }
    100% { transform: rotate(-15deg) translate(2px, 3px); }
}

/* Анимация натяжения лески */
@keyframes lineTension {
    0%, 100% { d: path("M300,300 Q450,750 1020,1100"); }
    25% { d: path("M300,300 Q350,650 1020,1100"); }
    75% { d: path("M300,300 L1020,1100"); }
}

/* SVG Fishing Line */
.fishing-line-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    transform: translateX(-2%) translateY(-8%);
    z-index: 7;
    pointer-events: none;
    opacity: 1;
    transition: all 1s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.fishing-line-path {
    fill: none;
    stroke: #3a3a3a;
    stroke-width: 3;
    stroke-linecap: round;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
    transition: d 2s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Применяем анимацию к SVG path когда удочка в состоянии biting */
.rod-sprite.biting .fishing-line-path {
    animation: lineTension 2s ease-in-out infinite;
}

.rod-sprite.idle .fishing-line-svg,
.rod-sprite.casting .fishing-line-svg,
.rod-sprite.waiting .fishing-line-svg,
.rod-sprite.biting .fishing-line-svg,
.rod-sprite.catching .fishing-line-svg,
.rod-sprite.returning .fishing-line-svg {
    opacity: 1;
}

/* Якорная точка для поплавка */
.rod-tip-anchor {
    position: absolute;
    right: -4px;
    top: 46px;
    width: 1px;
    height: 1px;
    background: transparent;
    z-index: 15;
    pointer-events: none;
}

/* Fishing Float */
.fishing-float-css {
    position: absolute;
    left: 2px;
    top: 124px;
    width: 6px;
    height: 10px;
    background: linear-gradient(180deg, #ff4444 0%, #ffffff 50%, #ff4444 100%);
    border-radius: 50% 50% 70% 70%;
    border: 1px solid rgba(0,0,0,0.2);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: floatAsWeight 3s ease-in-out infinite;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    z-index: 9;
    pointer-events: none;
    font-size: 0; /* Скрываем эмодзи */
}

/* Позиции поплавка для разных состояний */
.rod-sprite.idle .fishing-float-css {
    left: -18px;
    top: 133px;
    animation: floatAsWeightIdle 2s ease-in-out infinite;
    opacity: 1;
}

.rod-sprite.casting .fishing-float-css,
.rod-sprite.waiting .fishing-float-css,
.rod-sprite.biting .fishing-float-css,
.rod-sprite.catching .fishing-float-css {
    left: 55px;
    top: 136px;
    animation: floatAsWeight 3s ease-in-out infinite;
    opacity: 1;
}

.rod-sprite.biting .fishing-float-css {
    animation: floatBite 0.3s ease-in-out infinite;
}

@keyframes floatBite {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.1); }
}

/* Анимация поплавка как грузика */
@keyframes floatAsWeight {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(2px) translateX(1px);
    }
    50% {
        transform: translateY(-1px) translateX(-1px);
    }
    75% {
        transform: translateY(1px) translateX(0px);
    }
}

/* Анимация поплавка для idle */
@keyframes floatAsWeightIdle {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(1px);
    }
}

/* Location Name */
.fishing-location {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
}
