/* Graffiti Tree Container */
.graffiti-tree-container {
    position: relative;
    width: 300px;
    height: 400px;
    margin: 2rem auto;
    overflow: visible;
}

.graffiti-tree {
    position: relative;
    width: 100%;
    height: 100%;
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.3));
}

.tree-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Graffiti-style Strokes and Fills */
.graffiti-stroke {
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: url(#roughen);
}

.graffiti-fill {
    filter: url(#roughen);
}

/* Tree Animation - Swaying in Strong Wind */
.tree-svg {
    animation: treeSwayStrong 4s ease-in-out infinite;
    transform-origin: 50% 90%;
}

@keyframes treeSwayStrong {
    0%, 100% { 
        transform: rotate(-2deg) translateX(-2px);
    }
    25% { 
        transform: rotate(1deg) translateX(1px);
    }
    50% { 
        transform: rotate(-1deg) translateX(-1px);
    }
    75% { 
        transform: rotate(2deg) translateX(2px);
    }
}

/* Individual Pine Layer Animations */
.pine-layer {
    animation: pineLayerSway 3.5s ease-in-out infinite;
    transform-origin: center;
}

.bottom-layer {
    animation-delay: 0s;
    animation-duration: 4.2s;
}

.middle-layer {
    animation-delay: -0.5s;
    animation-duration: 3.8s;
}

.top-layer {
    animation-delay: -1s;
    animation-duration: 3.4s;
}

.tree-top {
    animation-delay: -1.5s;
    animation-duration: 3s;
}

@keyframes pineLayerSway {
    0%, 100% { 
        transform: translateX(-1px) rotate(-0.5deg);
    }
    50% { 
        transform: translateX(1px) rotate(0.5deg);
    }
}

/* Graffiti Highlights Animation */
.graffiti-highlight {
    animation: highlightPulse 2s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% { 
        opacity: 0.4;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.2);
    }
}

/* Wind Lines Animation */
.wind-line {
    animation: windFlow 2.5s ease-in-out infinite;
    stroke-linecap: round;
}

@keyframes windFlow {
    0% { 
        opacity: 0.2;
        stroke-dasharray: 0 20;
    }
    50% { 
        opacity: 0.6;
        stroke-dasharray: 10 10;
    }
    100% { 
        opacity: 0.2;
        stroke-dasharray: 20 0;
    }
}

/* Confetti Animation */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.confetti-piece {
    position: absolute;
    font-size: 1.5rem;
    color: var(--primary);
    animation: confettiFall 6s linear infinite;
    animation-delay: var(--delay);
    opacity: 0;
}

.confetti-1 { left: 20%; top: -10%; }
.confetti-2 { left: 40%; top: -15%; }
.confetti-3 { left: 60%; top: -5%; }
.confetti-4 { left: 80%; top: -12%; }
.confetti-5 { left: 30%; top: -8%; }
.confetti-6 { left: 70%; top: -18%; }

@keyframes confettiFall {
    0% {
        opacity: 0;
        transform: translateY(-20px) rotate(0deg) scale(0.5);
    }
    10% {
        opacity: 1;
        transform: translateY(0px) rotate(45deg) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(400px) rotate(720deg) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateY(450px) rotate(810deg) scale(0.3);
    }
}

/* Graffiti-style Text */
.graffiti-text {
    position: absolute;
    top: 50%;
    right: -80px;
    transform: translateY(-50%);
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.strength-text {
    font-size: 1.2rem;
    color: var(--primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: textGlow 3s ease-in-out infinite;
    margin-bottom: 5px;
}

.roots-text {
    font-size: 1rem;
    color: #2d4a22;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    animation: textGlow 3s ease-in-out infinite reverse;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
        transform: scale(1);
    }
    50% {
        text-shadow: 2px 2px 8px var(--primary), 0 0 10px var(--primary);
        transform: scale(1.05);
    }
}

/* SVG Filter for Graffiti Effect */
.graffiti-tree-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .graffiti-tree-container {
        width: 250px;
        height: 350px;
    }
    
    .graffiti-text {
        right: -60px;
        font-size: 0.9rem;
    }
    
    .confetti-piece {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .graffiti-tree-container {
        width: 200px;
        height: 300px;
    }
    
    .graffiti-text {
        right: -50px;
        font-size: 0.8rem;
    }
}

/* Interaction Effects */
.graffiti-tree:hover .tree-svg {
    animation-duration: 2s;
}

.graffiti-tree:hover .confetti-piece {
    animation-duration: 3s;
}

.graffiti-tree:hover .graffiti-highlight {
    animation-duration: 1s;
}
