/* MSI Cache Coherence Protocol Simulator - Bulma Theme */
@import url('https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css');

:root {
  --primary-color: #176696;
  --secondary-color: #2C9AD1;
  --accent-color: #98CB3B;
  --neutral-color: #96A0A3;
}

/* Main Content Area */
.content-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .content-container {
    padding: 1rem;
    padding-top: 4rem;
  }
}

/* Custom Bulma theme overrides */
.hero.is-primary {
  background-color: var(--primary-color) !important;
}

.button.is-primary {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

.button.is-primary:hover {
  background-color: var(--secondary-color) !important;
  border-color: var(--secondary-color) !important;
}

.tag.is-success {
  background-color: var(--accent-color) !important;
}

.has-background-light-custom {
  background-color: #f8f9fa !important;
}

/* State diagram styling */
.state-diagram {
  width: 100%;
  height: auto;
  background-color: white;
  border-radius: 6px;
}

.state-diagram text {
  font-family: inherit;
  user-select: none;
}

/* Cache state styling */
.cache-table .state-m {
  color: var(--primary-color);
  font-weight: bold;
}

.cache-table .state-s {
  color: var(--secondary-color);
  font-weight: bold;
}

.cache-table .state-i {
  color: var(--neutral-color);
  font-weight: bold;
}

/* Transaction log styling */
.log-table .state-m {
  color: var(--primary-color);
  font-weight: bold;
}

.log-table .state-s {
  color: var(--secondary-color);
  font-weight: bold;
}

.log-table .state-i {
  color: var(--neutral-color);
  font-weight: bold;
}

.log-table .latest-entry {
  background-color: #f5f5f5;
  font-weight: bold;
}

/* Responsive adjustments for state diagram text */
@media (max-width: 768px) {
  .state-diagram text[font-size="10"] {
    font-size: 8;
  }
  
  .state-diagram text[font-size="11"] {
    font-size: 9;
  }
  
  .state-diagram text[font-size="12"] {
    font-size: 10;
  }
  
  .state-diagram text[font-size="24"] {
    font-size: 20;
  }
}

@media (max-width: 480px) {
  .state-diagram text[font-size="10"] {
    font-size: 7;
  }
  
  .state-diagram text[font-size="11"] {
    font-size: 8;
  }
  
  .state-diagram text[font-size="12"] {
    font-size: 9;
  }
  
  .state-diagram text[font-size="24"] {
    font-size: 18;
  }
}

/* Custom processor header colors */
.processor-0-header {
  background-color: var(--primary-color) !important;
  color: white !important;
}

.processor-1-header {
  background-color: var(--secondary-color) !important;
  color: white !important;
}

/* Utility classes */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* Animation for state transitions */
@keyframes highlight {
  0% { background-color: var(--accent-color); }
  100% { background-color: transparent; }
}

.transition-highlight {
  animation: highlight 1s ease-in-out;
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
  .columns.is-multiline .column.is-half-tablet {
    flex: none;
    width: 50%;
  }
  
  .columns.is-multiline .column.is-one-quarter-desktop {
    flex: none;
    width: 100%;
  }
  
  .title.is-2 {
    font-size: 2rem !important;
  }
  
  .title.is-3 {
    font-size: 1.75rem !important;
  }
  
  .title.is-4 {
    font-size: 1.5rem !important;
  }
  
  .subtitle.is-5 {
    font-size: 1.1rem !important;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .log-table th,
  .log-table td {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.5rem;
  }
  
  .cache-table th,
  .cache-table td {
    font-size: 0.9rem;
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .hero-body {
    padding: 2rem 1rem !important;
  }
  
  .section {
    padding: 1.5rem 0.75rem !important;
  }
  
  .box {
    padding: 1rem !important;
  }
  
  .button.is-large {
    font-size: 1rem !important;
    padding: 0.75rem 1.5rem !important;
  }
  
  .columns.is-multiline .column {
    padding: 0.25rem !important;
  }
  
  .field {
    margin-bottom: 0.75rem !important;
  }
  
  .log-table th,
  .log-table td {
    font-size: 0.75rem;
    padding: 0.25rem;
  }
  
  .cache-table th,
  .cache-table td {
    font-size: 0.8rem;
    padding: 0.35rem;
  }
  
  .notification {
    padding: 0.75rem !important;
  }
}

/* Stack control columns on very small screens */
@media (max-width: 600px) {
  .columns.is-multiline .column.is-half-tablet,
  .columns.is-multiline .column.is-one-quarter-desktop {
    flex: none;
    width: 100%;
  }
}

/* Improve SVG responsiveness */
.state-diagram {
  max-width: 100%;
  height: auto;
}

/* Better table scroll on mobile */
.table-container {
  border-radius: 6px;
  box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1);
}

/* Mobile-first button styling */
.button.is-primary.is-large {
  min-width: 200px;
  font-weight: 600;
}

@media (max-width: 480px) {
  .button.is-primary.is-large {
    min-width: 150px;
    width: 100%;
    max-width: 250px;
  }
}

/* Link styling for references */
.has-text-link {
  color: var(--primary-color) !important;
  text-decoration: underline;
}

.has-text-link:hover {
  color: var(--secondary-color) !important;
}