/**
 * About Me Sleek & Edge-to-Edge Timeline Styles
 * cristianodeluca.it
 */

.about-me-section {
    position: relative;
    padding-top: 2rem;
    padding-bottom: 5rem;
    overflow-x: hidden;
}

/* Header Styling */
.about-me-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;
}

.about-me-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #55ddff 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.about-me-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* Central Timeline Container - Extra Wide Max Width (1180px) */
.cdl-timeline {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.5rem 0;
    z-index: 1;
}

/* Central Vertical Axis Line */
.cdl-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #55ddff 0%, #a855f7 50%, #3b82f6 100%);
    box-shadow: 0 0 8px rgba(85, 221, 255, 0.4);
    z-index: 0;
}

/* Desktop Axis Positioning (Centered) */
@media (min-width: 992px) {
    .cdl-timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Mobile Axis Positioning (Left aligned) */
@media (max-width: 991px) {
    .cdl-timeline::before {
        left: 20px;
    }
}

/* Timeline Item Container */
.cdl-timeline-item {
    position: relative;
    margin-bottom: 2.75rem;
    width: 100%;
    z-index: 1;
}

.cdl-timeline-item:last-child {
    margin-bottom: 0;
}

/* Timeline Node Dot - Fixed Position, Zoom on Hover (no shifting) */
.cdl-timeline-node {
    position: absolute;
    top: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0d1117 !important;
    border: 2px solid #55ddff;
    box-shadow: 0 0 12px rgba(85, 221, 255, 0.5), inset 0 0 8px rgba(85, 221, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #55ddff;
    font-size: 1.05rem;
    z-index: 10;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.cdl-timeline-node i {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hover: Icon zooms without shifting node position */
.cdl-timeline-item:hover .cdl-timeline-node {
    border-color: #a855f7;
    color: #a855f7;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.7);
}

.cdl-timeline-item:hover .cdl-timeline-node i {
    transform: scale(1.35);
}

/* Glassmorphic Card - Extra Wide & Taller */
.cdl-timeline-card {
    position: relative;
    background: rgba(22, 27, 34, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 0;
    overflow: hidden;
    min-height: 270px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    z-index: 5;
}

.cdl-timeline-item:hover .cdl-timeline-card {
    transform: translateY(-5px);
    border-color: rgba(85, 221, 255, 0.35);
    box-shadow: 0 14px 35px rgba(85, 221, 255, 0.15);
}

/* Taller Edge-to-Edge Media Header (280px height) */
.cdl-timeline-media-header {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    margin: 0;
    flex-shrink: 0;
}

.cdl-timeline-media-header .cdl-timeline-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.cdl-timeline-card:hover .cdl-timeline-img {
    transform: scale(1.05);
}

/* Overlay gradient for Title & Badge over Image */
.cdl-timeline-media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4rem 1.8rem 1.25rem 1.8rem;
    background: linear-gradient(to top, rgba(13, 17, 23, 0.96) 0%, rgba(13, 17, 23, 0.65) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 2;
}

.cdl-timeline-media-overlay .cdl-timeline-badge {
    margin-bottom: 0.45rem;
    background: rgba(85, 221, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(85, 221, 255, 0.5);
}

.cdl-timeline-media-overlay .cdl-timeline-title {
    margin-bottom: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Non-media Header Container */
.cdl-timeline-header-text {
    padding: 1.8rem 1.8rem 0.5rem 1.8rem;
}

/* Year Badge */
.cdl-timeline-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, rgba(85, 221, 255, 0.15), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(85, 221, 255, 0.3);
    color: #55ddff;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.25rem 0.9rem;
    border-radius: 20px;
    margin-bottom: 0.6rem;
    letter-spacing: 0.5px;
}

/* Title */
.cdl-timeline-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

/* Content Body */
.cdl-timeline-body {
    padding: 1.6rem 1.8rem 1.8rem 1.8rem;
    flex-grow: 1;
}

.cdl-timeline-body p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.935rem;
    line-height: 1.65;
    margin-bottom: 0.8rem;
}

.cdl-timeline-body p:last-child {
    margin-bottom: 0;
}

/* Cartoon "To Be Continued..." Banner at bottom */
.cdl-tbc-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 4.5rem;
    position: relative;
    z-index: 10;
}

.cdl-tbc-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
    border: 3.5px solid #000000;
    border-radius: 12px;
    padding: 0.65rem 1.75rem 0.65rem 1.25rem;
    box-shadow: 6px 6px 0px #000000, 0 0 25px rgba(250, 204, 21, 0.4);
    animation: cartoonBounce 2.5s infinite ease-in-out;
    transform-origin: center;
    cursor: default;
    user-select: none;
}

.cdl-tbc-arrow {
    background: #000000;
    color: #facc15;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transform: rotate(0deg);
    box-shadow: 2px 2px 0px rgba(255, 255, 255, 0.2);
}

.cdl-tbc-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    font-style: italic;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
}

@keyframes cartoonBounce {
    0%, 100% {
        transform: scale(1) rotate(-1.5deg);
    }
    50% {
        transform: scale(1.06) rotate(1.5deg);
    }
}

/* Desktop Grid Alignment - Extra Wide Cards (550px+ width per card) */
@media (min-width: 992px) {
    .cdl-timeline-item {
        display: flex;
    }

    .cdl-timeline-node {
        left: 50%;
        transform: translateX(-50%);
    }

    .cdl-timeline-card {
        width: calc(50% - 32px);
    }

    /* Odd items -> Left side */
    .cdl-timeline-item:nth-child(odd) {
        justify-content: flex-start;
    }

    .cdl-timeline-item:nth-child(odd) .cdl-timeline-card {
        text-align: left;
    }

    /* Even items -> Right side */
    .cdl-timeline-item:nth-child(even) {
        justify-content: flex-end;
    }

    .cdl-timeline-item:nth-child(even) .cdl-timeline-card {
        text-align: left;
    }

    /* Full-width items on Desktop (e.g. 2019, 2020+) with mathematically centered node dot */
    .cdl-timeline-item.cdl-timeline-item-full {
        position: relative;
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-bottom: 3.5rem;
        padding-top: 24px;
    }

    .cdl-timeline-item.cdl-timeline-item-full .cdl-timeline-node {
        position: absolute !important;
        top: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin: 0 !important;
        z-index: 10;
    }

    .cdl-timeline-item.cdl-timeline-item-full:hover .cdl-timeline-node {
        border-color: #a855f7;
        color: #a855f7;
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.7);
    }

    .cdl-timeline-item.cdl-timeline-item-full:hover .cdl-timeline-node i {
        transform: scale(1.35);
    }

    .cdl-timeline-item.cdl-timeline-item-full .cdl-timeline-card {
        width: 100% !important;
        text-align: left;
        padding-top: 0;
    }
}

/* Mobile & Tablet Layout */
@media (max-width: 991px) {
    .about-me-title {
        font-size: 1.85rem;
    }

    .cdl-timeline-node {
        left: 20px;
        transform: translateX(-50%);
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
        top: 14px;
    }

    .cdl-timeline-card {
        width: calc(100% - 50px);
        margin-left: 50px;
    }

    .cdl-timeline-media-header {
        height: 210px;
    }

    .cdl-timeline-item.cdl-timeline-item-full {
        padding-top: 0 !important;
    }

    .cdl-timeline-item.cdl-timeline-item-full .cdl-timeline-card {
        width: calc(100% - 50px) !important;
        margin-left: 50px !important;
    }

    .cdl-timeline-item.cdl-timeline-item-full .cdl-timeline-node {
        position: absolute !important;
        left: 20px !important;
        top: 14px !important;
        margin-bottom: 0 !important;
    }

    .cdl-tbc-banner {
        padding: 0.5rem 1.35rem 0.5rem 0.95rem;
    }

    .cdl-tbc-text {
        font-size: 1.1rem;
    }

    .cdl-tbc-arrow {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
}
