/* Custom styles for Dzednikan Language Website */

/* Custom scrollbar for modern browsers */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background-color: #3498db;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #2980b9;
}

/* Custom transitions */
.phrase, button, a {
    transition: all 0.3s ease;
}

/* Better focus styles */
button:focus, input:focus, textarea:focus, a:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.3);
}

/* Hero section enhancement */
#home {
    position: relative;
    overflow: hidden;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"%3E%3Cpath fill="%23ffffff" fill-opacity="0.05" d="M0,192L48,197.3C96,203,192,213,288,192C384,171,480,117,576,112C672,107,768,149,864,165.3C960,181,1056,171,1152,165.3C1248,160,1344,160,1392,160L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"%3E%3C/path%3E%3C/svg%3E');
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0.8;
    z-index: 0;
}

#home > div {
    position: relative;
    z-index: 1;
}

/* Enhanced typography */
h1, h2, h3, h4 {
    letter-spacing: 0.025em;
}

h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

h2, h3 {
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, #2ecc71, #3498db);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Card hover effect */
.bg-dzed-light-green {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.bg-dzed-light-green:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.15);
}

/* Dictionary entries */
.dictionary-list li {
    padding: 0.625rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dictionary-list li:hover {
    background-color: rgba(255, 255, 255, 0.7);
    border-left-color: #3498db;
    padding-left: 1rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

/* Phrase emphasis */
.phrase {
    position: relative;
    overflow: hidden;
}

.phrase::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.phrase:hover::before {
    width: 100%;
}

/* Example sentences enhancement */
.sentence-list div {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sentence-list div:hover {
    background-color: rgba(46, 204, 113, 0.08);
    border-bottom-color: #3498db;
    padding-left: 1rem;
    transform: translateX(5px);
}

/* Responsive font sizes */
@media (max-width: 640px) {
    h1 {
        font-size: 2.25rem !important;
    }
    h2 {
        font-size: 1.875rem !important;
    }
    h3 {
        font-size: 1.5rem !important;
    }
    p, li, a {
        font-size: 1rem !important;
    }
}

/* Beautiful animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes animateText {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 1s ease-in-out forwards;
    opacity: 0;
}

.slide-in-left {
    animation: slideInLeft 1s ease-in-out forwards;
    opacity: 0;
}

.slide-in-right {
    animation: slideInRight 1s ease-in-out forwards;
    opacity: 0;
}

.slide-in-bottom {
    animation: slideInBottom 1s ease-in-out forwards;
    opacity: 0;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

.floating {
    animation: float 3s ease-in-out infinite;
}

.hover-float:hover {
    transform: translateY(-3px);
}

.animate-text {
    background: linear-gradient(to right, #2ecc71, #3498db, #2ecc71);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: animateText 5s linear infinite;
}

/* Observer for animations */
.reveal {
    position: relative;
    opacity: 0;
    transition: all 1s ease;
}

.reveal.active {
    opacity: 1;
}

.reveal.active.from-left {
    transform: translateX(0);
}

.reveal.active.from-right {
    transform: translateX(0);
}

.reveal.active.from-bottom {
    transform: translateY(0);
}

.reveal:not(.active).from-left {
    transform: translateX(-100px);
}

.reveal:not(.active).from-right {
    transform: translateX(100px);
}

.reveal:not(.active).from-bottom {
    transform: translateY(50px);
}

/* Smooth page reveal animation */
body {
    animation: fadeIn 0.5s ease-in-out;
    background-color: #f7f3e8; /* Cream background that's easier on the eyes */
}

/* Animation for dictionary item neighbors */
.slight-move-up {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

.slight-move-down {
    transform: translateY(2px);
    transition: transform 0.3s ease;
}

/* Additional animation keyframes */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-2px);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

/* Dark mode preferences */
.dark-preference {
    filter: brightness(0.97);
}

/* Additional animation for active phrases */
.phrase.active {
    animation: bounce 2s ease;
}

/* Smooth scrolling for entire page */
html {
    scroll-behavior: smooth;
} 