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

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes progressBar {
    from { width: 0; }
    to { width: var(--scroll-width, 0%); }
}

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

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Reading Progress Bar */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(221, 38, 41, 0.1);
    z-index: 9999;
}

.reading-progress-bar {
    height: 100%;
    background: var(--fenix-red);
    width: 0;
    transition: width 0.1s ease;
    animation: progressBar 0.3s ease-out;
}

/* Page Header */
.page-header {
    animation: fadeIn 1s ease-out;
}

.page-header h1 {
    animation: fadeInUp 0.8s ease-out;
}

.page-header p {
    animation: fadeInUp 0.8s ease-out 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* Cookies Navigation */
.cookies-nav {
    animation: slideInLeft 0.8s ease-out;
    transition: all 0.3s ease;
}

.cookies-nav:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.cookies-nav ul li {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.cookies-nav ul li:nth-child(1) { animation-delay: 0.1s; }
.cookies-nav ul li:nth-child(2) { animation-delay: 0.2s; }
.cookies-nav ul li:nth-child(3) { animation-delay: 0.3s; }
.cookies-nav ul li:nth-child(4) { animation-delay: 0.4s; }
.cookies-nav ul li:nth-child(5) { animation-delay: 0.5s; }
.cookies-nav ul li:nth-child(6) { animation-delay: 0.6s; }
.cookies-nav ul li:nth-child(7) { animation-delay: 0.7s; }

.cookies-nav a {
    transition: all 0.3s ease;
}

.cookies-nav a:hover {
    color: var(--fenix-red);
    transform: translateX(10px);
}

/* Cookies Sections */
.cookies-section {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: calc(var(--section-index, 0) * 0.2s);
    transition: all 0.3s ease;
}

.cookies-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.cookies-section h2 {
    position: relative;
    padding-left: 20px;
}

.cookies-section h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--fenix-red);
    transition: height 0.3s ease;
}

.cookies-section:hover h2::before {
    height: 100%;
}

.cookies-section h2::after {
    transition: width 0.3s ease;
}

.cookies-section:hover h2::after {
    width: 100px;
}

/* Cookie Type Cards */
.cookie-card {
    opacity: 0;
    animation: scaleIn 0.8s ease-out forwards;
    animation-delay: calc(var(--card-index, 0) * 0.2s);
    transition: all 0.3s ease;
    background: white;
    border-radius: 15px;
    padding: 2rem;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cookie-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0,0,0,0.1);
}

.cookie-icon {
    font-size: 2.5rem;
    color: var(--fenix-red);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.cookie-card:hover .cookie-icon {
    transform: scale(1.2);
    animation: bounce 1s ease infinite;
}

/* Cookie Consent Banner */
.cookie-consent-banner {
    animation: slideInRight 0.8s ease-out;
}

.cookie-consent-content {
    animation: fadeIn 0.8s ease-out 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.cookie-preferences {
    animation: fadeIn 0.8s ease-out 0.4s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.cookie-consent-banner .btn {
    transition: all 0.3s ease;
}

.cookie-consent-banner .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.cookie-consent-banner .btn-primary {
    position: relative;
    overflow: hidden;
}

.cookie-consent-banner .btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255,255,255,0.3) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
}

.cookie-consent-banner .btn-primary:hover::after {
    animation: shimmer 1.5s infinite;
}

/* Cookie Settings Form */
.cookie-settings-form {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.form-check {
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 10px;
}

.form-check:hover {
    background: rgba(221, 38, 41, 0.05);
    transform: translateX(5px);
}

.form-check-input {
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: var(--fenix-red);
    border-color: var(--fenix-red);
    animation: pulse 0.3s ease;
}

/* Table Styles */
.table-responsive {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.2s;
}

.table {
    transition: all 0.3s ease;
}

.table th {
    position: relative;
    overflow: hidden;
}

.table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--fenix-red);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.table th:hover::after {
    transform: translateX(0);
}

/* Responsive Animations */
@media (max-width: 768px) {
    .cookies-section {
        animation-delay: calc(var(--section-index, 0) * 0.1s);
    }
    
    .cookies-nav ul li {
        animation-delay: calc(var(--item-index, 0) * 0.1s);
    }
    
    .cookie-card {
        animation-delay: calc(var(--card-index, 0) * 0.1s);
    }
}
