/* Cool Timeline Pro - Compact Media Layout */
.cool-timeline {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}


/* Condensed Timeline Layout */
.ctl-condensed .ctl-item {
    margin-bottom: 15px;
    padding-left: 40px;
}

.ctl-condensed .ctl-item-content {
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
}

.ctl-condensed .ctl-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.ctl-condensed .ctl-date {
    font-weight: bold;
    color: #007cba;
    margin: 0;
    font-size: 0.85em;
    background: #f0f7ff;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #007cba20;
}

.ctl-condensed .ctl-title {
    margin: 0;
    font-size: 1.1em;
    color: #333;
    flex: 1;
}

.ctl-condensed .ctl-meta-items {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75em;
    color: #666;
}

.ctl-condensed .ctl-meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
}

.ctl-condensed .ctl-content {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
    color: #555;
}

.ctl-condensed .ctl-content p {
    margin: 0 0 5px 0;
}

.ctl-condensed .ctl-content p:last-child {
    margin-bottom: 0;
}

.ctl-condensed .ctl-media-icons {
    margin: 8px 0 0 0;
    gap: 6px;
}

.ctl-condensed .ctl-media-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.ctl-condensed .ctl-research-badge {
    font-size: 0.65em;
    padding: 1px 5px;
    margin-left: 5px;
}

.ctl-condensed .ctl-importance-indicator {
    margin-left: 5px;
    font-size: 0.8em;
}

.ctl-condensed .ctl-source-info {
    margin: 8px 0 0 0;
    padding: 6px 8px;
    font-size: 0.8em;
}

/* Make the timeline line more subtle in condensed mode */
.ctl-condensed.ctl-layout-vertical .ctl-item:before {
    left: 18px;
    width: 1px;
    background: #e9ecef;
}

.ctl-condensed.ctl-layout-vertical .ctl-item:after {
    left: 14px;
    width: 8px;
    height: 8px;
    background: #6c757d;
}

/* Compact media containers for condensed mode */
.ctl-condensed .ctl-media-container {
    margin: 10px 0 0 0;
}

.ctl-condensed .ctl-gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 5px;
}

.ctl-condensed .ctl-gallery-grid img {
    height: 60px;
}

.ctl-condensed .ctl-video-embed iframe {
    height: 200px;
}

.ctl-condensed .ctl-self-hosted-video video {
    max-height: 200px;
}

/* Responsive adjustments for condensed mode */
@media (max-width: 768px) {
    .ctl-condensed .ctl-header {
        gap: 6px;
    }
    
    .ctl-condensed .ctl-meta-items {
        gap: 5px;
    }
    
    .ctl-condensed .ctl-item {
        padding-left: 30px;
    }
    
    .ctl-condensed.ctl-layout-vertical .ctl-item:before {
        left: 13px;
    }
    
    .ctl-condensed.ctl-layout-vertical .ctl-item:after {
        left: 10px;
    }
}

/* Hover effects for better interaction */
.ctl-condensed .ctl-item-content:hover {
    border-color: #007cba;
    box-shadow: 0 1px 3px rgba(0, 124, 186, 0.1);
}

/* Print styles for condensed mode */
@media print {
    .ctl-condensed .ctl-item-content {
        border: 1px solid #000;
        break-inside: avoid;
    }
    
    .ctl-condensed .ctl-media-icons {
        display: none;
    }
}




/* Vertical Layout */
.ctl-layout-vertical .ctl-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 50px;
}

.ctl-layout-vertical .ctl-item:before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: -30px;
    width: 2px;
    background: #ddd;
    z-index: 1;
}

.ctl-layout-vertical .ctl-item:last-child:before {
    display: none;
}

.ctl-layout-vertical .ctl-item:after {
    content: '';
    position: absolute;
    left: 15px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #007cba;
    z-index: 2;
}

/* Item Content */
.ctl-item-content {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #007cba;
    position: relative;
    z-index: 3;
}

.ctl-date {
    font-weight: bold;
    color: #007cba;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.ctl-title {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    color: #333;
}

.ctl-content {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.ctl-content p {
    margin: 0 0 15px 0;
}

.ctl-content p:last-child {
    margin-bottom: 0;
}

/* Historical Research Features */
.ctl-research-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: bold;
    margin-left: 10px;
    text-transform: uppercase;
}

.ctl-badge-needs_research { background: #ff6b6b; color: white; }
.ctl-badge-in_progress { background: #ffd93d; color: #333; }
.ctl-badge-verified { background: #6bcf7f; color: white; }
.ctl-badge-complete { background: #4d96ff; color: white; }

.ctl-importance-indicator {
    display: inline-flex;
    margin-left: 10px;
}

.ctl-importance-star {
    color: #ffd700;
    margin-right: 2px;
}

.ctl-story-meta {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    font-size: 0.9em;
    color: #666;
}

.ctl-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ctl-source-info {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #007cba;
    margin: 10px 0;
    font-size: 0.9em;
}

.ctl-source-info strong {
    color: #333;
}

/* Book-ready print styles */
@media print {
    .ctl-media-icons,
    .ctl-close-media,
    .wp-admin-bar {
        display: none !important;
    }
    
    .ctl-media-container {
        display: block !important;
        break-inside: avoid;
    }
    
    .ctl-item-content {
        border: 1px solid #000;
        break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .cool-timeline {
        max-width: none;
        padding: 0;
    }
}


/* Media Icons Bar */
.ctl-media-icons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.ctl-media-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.ctl-media-icon:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
    transform: scale(1.1);
}

.ctl-media-icon.has-media {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* Media Containers (Initially Hidden) */
.ctl-media-container {
    display: none;
    margin: 15px 0;
    animation: fadeIn 0.3s ease;
}

.ctl-media-container.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Featured Image */
.ctl-featured-media img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* Video Container */
.ctl-video-container {
    width: 100%;
    margin: 15px 0;
}

.ctl-video-embed {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.ctl-video-embed iframe {
    width: 100%;
    height: 400px;
    display: block;
    border: none;
}

/* Self-hosted video */
.ctl-self-hosted-video {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.ctl-self-hosted-video video {
    width: 100%;
    max-height: 400px;
    display: block;
}

/* Video fallback */
.ctl-video-fallback {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.ctl-video-link {
    display: inline-block;
    padding: 12px 24px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    margin-top: 10px;
}

.ctl-video-link:hover {
    background: #005a87;
    color: white;
}

/* Gallery Grid */
.ctl-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.ctl-gallery-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.ctl-gallery-grid img:hover {
    transform: scale(1.05);
}

/* File Attachments */
.ctl-file-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.ctl-file-item {
    margin: 8px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007cba;
}

.ctl-file-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.ctl-file-link:hover {
    color: #007cba;
}

.ctl-file-icon {
    font-size: 18px;
}

.ctl-file-size {
    font-size: 0.8em;
    color: #666;
    margin-left: auto;
}

/* Close Button */
.ctl-close-media {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
}

.ctl-close-media:hover {
    background: #c82333;
}

/* Lightbox Styles */
.ctl-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.ctl-lightbox.active {
    display: flex;
}

.ctl-lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.ctl-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cool-timeline {
        padding: 10px;
    }
    
    .ctl-layout-vertical .ctl-item {
        padding-left: 30px;
    }
    
    .ctl-layout-vertical .ctl-item:before {
        left: 13px;
    }
    
    .ctl-layout-vertical .ctl-item:after {
        left: 8px;
    }
    
    .ctl-item-content {
        padding: 15px;
    }
    
    .ctl-title {
        font-size: 1.2em;
    }
    
    .ctl-media-icons {
        gap: 8px;
    }
    
    .ctl-media-icon {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .ctl-video-embed iframe {
        height: 300px;
    }
    
    .ctl-self-hosted-video video {
        max-height: 300px;
    }
    
    .ctl-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ctl-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .ctl-layout-vertical .ctl-item {
        padding-left: 25px;
    }
    
    .ctl-layout-vertical .ctl-item:before {
        left: 10px;
    }
    
    .ctl-layout-vertical .ctl-item:after {
        left: 5px;
        width: 10px;
        height: 10px;
    }
    
    .ctl-media-icons {
        justify-content: center;
    }
    
    .ctl-video-embed iframe {
        height: 250px;
    }
    
    .ctl-self-hosted-video video {
        max-height: 250px;
    }
}