﻿/* ================================ 
   Timeline Component Styles - Reversed Layout (No Buttons)
   Updated Class Names to Avoid Conflicts
================================ */

/* Timeline Variables */
:root {
    --timeline-main-text: #7f8c97;
    --timeline-link: #acb7c0;
    --timeline-background: #e9f0f5;
    --timeline-dark: #303e49;
    --timeline-red: #c03b44;
    --timeline-white: #ffffff;
    --timeline-green: #75ce66;
    --timeline-yellow: #f0ca45;
    --timeline-primary-font: "Cairo", "Droid Serif", serif;
    --timeline-secondary-font: "Tajawal", "Open Sans", sans-serif;
}

/* Timeline Section */
.codna-timeline-section {
    position: relative;
    z-index: 1;
    padding: 80px 0;
    background: #ffd7000a;
    overflow: hidden;
}

.codna-timeline-section .section-title {
    text-align: center;
    margin-bottom: 1rem;
}

.codna-timeline-section .section-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

/* Timeline Container */
.codna-timeline-container {
    width: 90%;
    max-width: 1170px;
    margin: 0 auto;
    position: relative;
}

.codna-timeline-container::after {
    content: "";
    display: table;
    clear: both;
}

/* Main Timeline */
.codna-timeline {
    position: relative;
    padding: 2em 0;
    margin: 2em 0;
    z-index: 1;
}

/* الخط العمودي - على اليسار في الموبايل */
.codna-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    left: 18px;
    height: 100%;
    width: 4px;
    background: linear-gradient(to bottom, var(--timeline-green), var(--timeline-red), var(--timeline-yellow));
    border-radius: 2px;
    z-index: 1;
}

/* Timeline Block */
.codna-timeline-block {
    position: relative;
    margin: 4em 0;
    z-index: 2;
    min-height: 200px;
}

.codna-timeline-block::after {
    content: "";
    display: table;
    clear: both;
}

.codna-timeline-block:first-child {
    margin-top: 0;
}

.codna-timeline-block:last-child {
    margin-bottom: 0;
}

/* Timeline Image/Icon - الافتراضي على اليسار */
.codna-timeline-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--timeline-white), inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
    z-index: 3;
    transition: all 0.3s ease;
}

.codna-timeline-img:hover {
    transform: scale(1.1);
}

.codna-timeline-img img {
    display: block;
    width: 24px;
    height: 24px;
    position: relative;
    left: 50%;
    top: 50%;
    margin-left: -12px;
    margin-top: -12px;
}

.codna-timeline-img.codna-picture {
    background: var(--timeline-green);
}

.codna-timeline-img.codna-movie {
    background: var(--timeline-red);
}

.codna-timeline-img.codna-location {
    background: var(--timeline-yellow);
}

/* Timeline Content - الافتراضي على اليمين */
.codna-timeline-content {
    position: relative;
    margin-left: 60px;
    background: var(--timeline-white);
    border-radius: 20px;
    padding: 2em;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 2;
    transition: all 0.4s ease;
}

.codna-timeline-content:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.codna-timeline-content::after {
    content: "";
    display: table;
    clear: both;
}

.codna-timeline-content h2 {
    color: var(--timeline-dark);
    font-family: var(--timeline-secondary-font);
    font-size: 1.8rem;
    margin-bottom: 0.8em;
    font-weight: 700;
}

.codna-timeline-content p {
    font-size: 1.4rem;
    line-height: 1.7;
    margin: 1em 0 1.5em 0;
    color: var(--timeline-main-text);
}

.codna-timeline-content .codna-date {
    font-size: 1.3rem;
    display: inline-block;
    float: left;
    padding: 0.8em 1em;
    opacity: 0.8;
    font-weight: 600;
    color: var(--timeline-green);
    background: rgba(117, 206, 102, 0.1);
    border-radius: 20px;
}

/* السهم الصغير للكونتنت */
.codna-timeline-content::before {
    content: "";
    position: absolute;
    top: 16px;
    right: 100%;
    height: 0;
    width: 0;
    border: 10px solid transparent;
    border-right: 10px solid var(--timeline-white);
}

/* ===== Timeline Images (الصور الجديدة) - مخفية في الموبايل ===== */
.codna-timeline-image {
    display: none; /* مخفية افتراضياً في الموبايل */
}

/* Animation Classes */
.codna-timeline-img.is-hidden,
.codna-timeline-content.is-hidden,
.codna-timeline-image.is-hidden {
    visibility: hidden;
}

.codna-timeline-img.bounce-in {
    visibility: visible;
    animation: codna-bounce-1 0.6s;
}

.codna-timeline-content.bounce-in {
    visibility: visible;
    animation: codna-bounce-2 0.6s;
}

.codna-timeline-image.bounce-in {
    visibility: visible;
    animation: codna-bounce-3 0.8s ease-out;
}

/* Medium screens */
@media only screen and (min-width: 768px) {
    .codna-timeline-content h2 {
        font-size: 2.2rem;
    }
    
    .codna-timeline-content p {
        font-size: 1.6rem;
    }
    
    .codna-timeline-content .codna-date {
        font-size: 1.4rem;
    }
}

/* Large screens - التصميم المعكوس مع صور ثابتة */
@media only screen and (min-width: 1170px) {
    .codna-timeline {
        margin: 4em 0;
    }
    
    /* الخط في المنتصف */
    .codna-timeline::before {
        left: 50%;
        margin-left: -2px;
        background: linear-gradient(to bottom, 
            var(--timeline-green) 0%, 
            var(--timeline-red) 30%, 
            var(--timeline-yellow) 60%, 
            var(--timeline-green) 80%, 
            var(--timeline-red) 100%);
    }
    
    .codna-timeline-block {
        margin: 6em 0;
        width: 100%;
        position: relative;
        min-height: 400px;
        display: block;
        overflow: visible;
    }
    
    .codna-timeline-block:first-child {
        margin-top: 0;
    }
    
    .codna-timeline-block:last-child {
        margin-bottom: 0;
    }
    
    /* الأيقونة في المنتصف بشكل ثابت */
    .codna-timeline-img {
        width: 70px;
        height: 70px;
        left: 50%;
        margin-left: -35px;
        top: 50px;
        position: absolute;
        box-shadow: 0 0 0 6px var(--timeline-white), 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    
    /* الافتراضي المعكوس: المحتوى على اليسار (خطوات فردية 1،3،5) */
    .codna-timeline-content {
        margin-left: 6%;
        margin-right: 0;
        padding: 2.5em;
        width: 40%;
        float: left;
        position: relative;
        margin-top: 20px;
    }
    
    /* السهم للمحتوى على اليسار (افتراضي معكوس للفردي) */
        .codna-timeline-content::before {
            top: 30px;
            right: auto;
            left: 100%;
            border: 15px solid transparent;
            border-left: 15px solid var(--timeline-white);
            border-right: none;
        }
    
    .codna-timeline-content .codna-date {
        position: absolute;
        width: auto;
        right: 110%;
        top: 15px;
        font-size: 1.4rem;
        text-align: right;
        float: none;
    }
    
    /* ===== الصور الجانبية الثابتة معكوسة ===== */
    .codna-timeline-image {
        display: block;
        position: absolute;
        width: 35%;
        height: 320px;
        top: 20px;
        right: 6%; /* الصور على اليمين افتراضياً للعناصر الفردية المعكوسة */
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
        z-index: 1;
        transition: box-shadow 0.3s ease, transform 0.3s ease;
    }
    
    .codna-timeline-image:hover {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
        transform: translateY(-3px);
    }
    
    .codna-timeline-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: none; /* إزالة أي تحريك للصورة */
    }
    
    /* Overlay للصور - بدون تأثيرات مفرطة */
    .timeline-image-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .timeline-image-overlay i {
        font-size: 2.5rem;
        color: white;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    }
    
    .codna-timeline-image:hover .timeline-image-overlay {
        opacity: 1;
    }
    
    /* العناصر الزوجية (2،4) - المحتوى على اليمين */
    .codna-timeline-block:nth-child(even) .codna-timeline-content {
        float: right;
        margin-left: 0;
        margin-right: 6%;
    }

        .codna-timeline-block:nth-child(even) .codna-timeline-content::before {
            top: 30px;
            right: 100%;
            left: auto;
            border: 15px solid transparent;
            border-right: 15px solid var(--timeline-white);
            border-left: none;
        }
    
    .codna-timeline-block:nth-child(even) .codna-timeline-content .codna-date {
        left: 110%;
        right: auto;
        text-align: left;
    }
    
    /* الصور للعناصر الزوجية (2،4) - على اليسار بشكل ثابت */
    .codna-timeline-block:nth-child(even) .codna-timeline-image {
        left: 6% !important;
        right: auto !important;
    }
    
    /* الانيميشن المبسط */
    .codna-timeline-block:nth-child(even) .codna-timeline-content.bounce-in {
        animation: codna-bounce-2-inverse 0.6s;
    }
    
    .codna-timeline-block:nth-child(even) .codna-timeline-image.bounce-in {
        animation: codna-bounce-3-inverse 0.8s ease-out;
    }
    
    /* تأثيرات إضافية للعناصر الفردية والزوجية */
    .codna-timeline-block:nth-child(odd) .codna-timeline-content {
        border-left: 4px solid var(--timeline-green);
    }
    
    .codna-timeline-block:nth-child(even) .codna-timeline-content {
        border-right: 4px solid var(--timeline-red);
    }
    
    /* تأثيرات الصور حسب النوع */
    .codna-timeline-block:nth-child(odd) .codna-timeline-image {
        border: 2px solid rgba(117, 206, 102, 0.2);
    }
    
    .codna-timeline-block:nth-child(even) .codna-timeline-image {
        border: 2px solid rgba(192, 59, 68, 0.2);
    }
}

/* Keyframes المبسطة للحركة الطبيعية */
@keyframes codna-bounce-1 {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes codna-bounce-2 {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes codna-bounce-2-inverse {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes codna-bounce-3 {
    0% {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes codna-bounce-3-inverse {
    0% {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}


