/* MOESI Cache Coherence Protocol Simulator - Bulma-based CSS */

/* Custom Variables */
:root {
    --primary-color: #176696;
    --secondary-color: #2C9AD1;
    --accent-color: #98CB3B;
    --neutral-color: #96A0A3;
    --text-color: #2C3E50;
    --background-color: #F8F9FA;
    --white-color: #FFFFFF;
    --highlight-p0: #BBDEFB;
    --highlight-p1: #C8E6C8;
    --highlight-both: #FFE0B2;
}

/* Base styles */
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Custom button styles */
.button.is-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.button.is-primary:hover {
    background-color: #145a82;
    border-color: #145a82;
}

/* Custom title colors */
.title {
    color: var(--primary-color);
}

/* Table enhancements */
.table td, .table th {
    vertical-align: middle;
}

.table.is-narrow td, .table.is-narrow th {
    padding: 0.5em 0.75em;
}

/* Responsive table scrolling */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* State transition highlighting */
.transition-highlight-p0 {
    background-color: var(--highlight-p0) !important;
    border-left: 4px solid var(--primary-color) !important;
}

.transition-highlight-p1 {
    background-color: var(--highlight-p1) !important;
    border-left: 4px solid var(--accent-color) !important;
}

.transition-highlight-both {
    background-color: var(--highlight-both) !important;
    border-left: 4px solid var(--neutral-color) !important;
}

/* Animation for state changes */
.state-change {
    animation: pulse 0.6s ease-in-out;
}

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

/* Legend styling fixes */
.tags.has-addons .tag:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.tags.has-addons .tag:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Ensure proper spacing for grouped elements */
.field.is-grouped.is-grouped-centered {
    justify-content: center;
    flex-wrap: wrap;
}

.field.is-grouped.is-grouped-multiline {
    flex-wrap: wrap;
}

/* Mobile-first responsive design */
@media screen and (max-width: 1023px) {
    .container.is-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-body {
        padding: 2rem 1.5rem;
    }
    
    .section {
        padding: 1.5rem 0;
    }
    
    .box {
        margin-bottom: 1rem;
    }
}

@media screen and (max-width: 768px) {
    .title.is-3-desktop {
        font-size: 1.75rem;
    }
    
    .subtitle.is-5-desktop {
        font-size: 1rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .button.is-medium {
        font-size: 1rem;
    }
    
    /* Stack columns on mobile */
    .columns {
        flex-direction: column;
    }
    
    .column {
        padding: 0.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .table {
        border: 2px solid #000;
    }
    
    .table td, .table th {
        border: 1px solid #000;
    }
    
    .box {
        border: 2px solid #000;
    }
}

/* Print styles */
@media print {
    .sidebar-column {
        display: none;
    }
    
    .button {
        display: none;
    }
    
    .box {
        box-shadow: none;
        border: 1px solid #000;
    }
}
