/*
* The People's Elbow - Development Ring Styles
* These styles are for the Development Ring page
*/

.changelog-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('../images/ring-bg.png');
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    padding: 5rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    border-bottom: 4px solid #CE9C00;
}

.changelog-hero h1 {
    font-family: 'Bangers', cursive;
    font-size: 4rem;
    margin-bottom: 0.5rem;
    text-shadow: 3px 3px 0 #CE9C00, 5px 5px 0 rgba(0, 0, 0, 0.5), 7px 7px 0 rgba(206, 156, 0, 0.3);
    letter-spacing: 3px;
    transform: rotate(-1deg);
    color: #00ff00;
}

.changelog-hero h2 {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #CE9C00;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.3;
}

.changelog-hero i {
    margin-left: 0.5rem;
}

#current-version {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: 3px solid #CE9C00;
    margin-top: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(206, 156, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 16px rgba(206, 156, 0, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(206, 156, 0, 0.3);
    }
}

.version-label {
    font-weight: bold;
    margin-right: 0.5rem;
}

.version-number {
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    color: #CE9C00;
}

.timeline-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Code tag styling */
.code-tag {
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.1);
    color: #CE9C00;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
    border: 1px solid rgba(206, 156, 0, 0.3);
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.timeline-intro {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    height: 100%;
    width: 4px;
    background: #CE9C00;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
}

.timeline-item {
    margin-bottom: 4rem;
    position: relative;
    width: 100%;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: auto;
    margin-right: 60px;
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: auto;
    margin-left: 60px;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -42px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -42px;
}

.timeline-content {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    width: calc(50% - 2rem);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    border-left: 5px solid #d0d0d0;
    transition: all 0.3s ease;
    overflow: visible; /* Ensure expanded content can flow outside */
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Color-coding based on commit type */
.timeline-content.feat {
    border-left-color: #4CAF50; /* Green for features */
}

.timeline-content.fix {
    border-left-color: #F44336; /* Red for fixes */
}

.timeline-content.docs {
    border-left-color: #2196F3; /* Blue for documentation */
}

.timeline-content.refactor {
    border-left-color: #FF9800; /* Orange for refactoring */
}

.timeline-content.style {
    border-left-color: #9C27B0; /* Purple for style changes */
}

.timeline-content.chore {
    border-left-color: #607D8B; /* Blue-grey for chores */
}

.timeline-dot {
    width: 24px;
    height: 24px;
    background-color: #CE9C00;
    border-radius: 50%;
    position: absolute;
    top: 1.5rem;
    z-index: 1;
    box-shadow: 0 0 0 4px rgba(206, 156, 0, 0.3);
}

/* Styles for expandable commit messages */
.timeline-message {
    font-weight: bold;
    margin-bottom: 0.5rem; /* Space before full message appears */
    position: relative; /* For positioning the toggle icon */
    padding-right: 25px; /* Space for the toggle icon */
    cursor: pointer;
    display: block; /* Make the whole area clickable */
}

.message-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9em;
    color: #777;
    transition: transform 0.3s ease;
}

.timeline-item.expanded .message-toggle i.fa-chevron-down {
    transform: translateY(-50%) rotate(180deg);
}

.timeline-item.expanded .message-toggle i.fa-chevron-up {
    transform: translateY(-50%) rotate(0deg); /* Resets if toggled back */
}

.timeline-full-message {
    display: none;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
    font-size: 0.95em;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word; /* Ensure long strings in commit bodies wrap */
    white-space: pre-wrap; /* Respect newlines converted to <br> and spaces */
}

.timeline-full-message.show {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

.timeline-full-message strong {
    color: #000;
    font-weight: bold;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px; /* Adjust if messages can be extremely long */
    }
}

/* Adjustments for odd/even alignment with new message structure */
.timeline-item:nth-child(odd) .timeline-message,
.timeline-item:nth-child(odd) .timeline-full-message {
    text-align: left; /* Keep details left-aligned even if overall content block is right */
}

.timeline-item:nth-child(even) .timeline-message,
.timeline-item:nth-child(even) .timeline-full-message {
    text-align: left;
}

.timeline-date {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.timeline-version {
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.timeline-tag {
    display: inline-block;
    background-color: #CE9C00;
    color: #fff;
    font-weight: bold;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.timeline-message {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease, background-color 0.3s ease;
    font-weight: bold;
    padding: 4px 8px;
    margin-left: -8px;
    border-radius: 4px;
}

.timeline-message:hover {
    background-color: rgba(206, 156, 0, 0.1);
}

.timeline-message:hover {
    color: #CE9C00;
}

.message-toggle {
    display: inline-block;
    margin-left: 6px;
    color: #CE9C00;
    transition: transform 0.3s ease;
}

.message-toggle i {
    font-size: 14px;
}

.timeline-full-message {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.8s ease, opacity 0.5s ease, padding 0.5s ease;
    opacity: 0;
    padding: 0;
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.6; /* Increased line-height for better readability */
    color: #333; /* Darker text for better contrast */
    border-left: 4px solid rgba(206, 156, 0, 0.5); /* More visible border */
    background-color: rgba(206, 156, 0, 0.08);
    border-radius: 0 4px 4px 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.timeline-full-message.show {
    max-height: 2000px; /* Further increased for extremely long messages */
    opacity: 1;
    padding: 16px 20px;
    margin: 10px 0;
    white-space: pre-line; /* Preserve line breaks better */
    text-align: left; /* Ensure text alignment is always left */
    width: calc(100% + 20px); /* Make it slightly wider than the container */
    margin-left: -10px; /* Offset the extra width */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); /* Add subtle shadow for depth */
}

/* Error message */
.timeline-error {
    text-align: center;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem auto;
    max-width: 600px;
}

.timeline-error i {
    font-size: 3rem;
    color: #CE9C00;
    margin-bottom: 1rem;
    display: block;
}

.timeline-error p {
    font-size: 1.2rem;
    color: #666;
}

/* Loading animation */
.loading-ring {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.loading-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 64px;
    height: 64px;
    margin: 8px;
    border: 8px solid #CE9C00;
    border-radius: 50%;
    animation: loading-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #CE9C00 transparent transparent transparent;
}

.loading-ring div:nth-child(1) {
    animation-delay: -0.45s;
}

.loading-ring div:nth-child(2) {
    animation-delay: -0.3s;
}

.loading-ring div:nth-child(3) {
    animation-delay: -0.15s;
}

@keyframes loading-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-message {
    text-align: center;
    margin-top: 1rem;
    font-family: 'Bangers', cursive;
    color: #666;
    font-size: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .changelog-hero h1 {
        font-size: 2.5rem;
    }
    
    .changelog-hero h2 {
        font-size: 1.4rem;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 60px;
        margin-right: auto;
        text-align: left;
        width: calc(100% - 75px);
    }
    
    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 18px;
        right: auto;
    }
}

/* D1 Changelog Specific Styles */
.error-message {
    text-align: center;
    padding: 2rem;
    background-color: rgba(255, 0, 0, 0.1);
    border: 2px solid #ff0000;
    border-radius: 8px;
    margin: 2rem 0;
}

.error-message i {
    font-size: 3rem;
    color: #ff0000;
    margin-bottom: 1rem;
}

.error-message h3 {
    color: #ff0000;
    margin-bottom: 1rem;
}

.retry-btn {
    background-color: #CE9C00;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.retry-btn:hover {
    background-color: #b88800;
}

.load-more-btn {
    display: block;
    margin: 2rem auto;
    background-color: #CE9C00;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.load-more-btn:hover {
    background-color: #b88800;
}

.load-more-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

.toggle-details {
    background-color: transparent;
    color: #CE9C00;
    border: 1px solid #CE9C00;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    margin-top: 0.75rem;
    transition: all 0.3s ease;
}

.toggle-details:hover {
    background-color: #CE9C00;
    color: white;
}

.commit-details {
    background-color: rgba(206, 156, 0, 0.05);
    border: 1px solid rgba(206, 156, 0, 0.2);
    border-radius: 4px;
    padding: 1rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.commit-details p {
    margin: 0.5rem 0;
}

.commit-details strong {
    color: #CE9C00;
}

.commit-hash {
    font-family: 'Courier New', monospace;
    background-color: rgba(206, 156, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.875rem;
    font-weight: bold;
}

.commit-author {
    color: #666;
    font-size: 0.875rem;
}

/* Update database icon color */
.changelog-hero h1 i.fa-database {
    color: #00ff00;
    text-shadow: 2px 2px 0 #CE9C00, 3px 3px 0 rgba(0, 0, 0, 0.5);
}

/* Changelog Explanation Section (clean, honest copy) */
.changelog-explanation {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    border-left: 4px solid #CE9C00;
}

.changelog-explanation h3 {
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    color: #CE9C00;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.changelog-explanation h3:first-child {
    margin-top: 0;
}

.changelog-explanation p {
    color: #ddd;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.changelog-explanation a {
    color: #CE9C00;
    text-decoration: underline;
}

.changelog-explanation a:hover {
    color: #fff;
}

/* Legacy Innovation Highlight Section (deprecated, keeping for reference) */
.innovation-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.innovation-highlight::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 15px,
        rgba(255,255,255,0.04) 15px,
        rgba(255,255,255,0.04) 30px
    );
    animation: shimmer 25s linear infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.innovation-highlight h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
    position: relative;
    z-index: 1;
    color: #c7ff8a;
    font-weight: 500;
    letter-spacing: 1.5px;
}

.innovation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.innovation-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.innovation-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.innovation-badge {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.innovation-item strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

.innovation-item p {
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.innovation-footer {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 1rem;
    position: relative;
    z-index: 1;
}

.innovation-claim {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.innovation-claim strong {
    color: #ffeb3b;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.innovation-evidence {
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.innovation-evidence em {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Responsive Design for Innovation Section */
@media (max-width: 768px) {
    .innovation-highlight {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .innovation-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .innovation-highlight h3 {
        font-size: 1.3rem;
    }
    
    .innovation-item {
        padding: 0.8rem;
    }
}
