/* =====================================================
   DTMC PAGE STYLES
===================================================== */

/* =====================================================
   HEADER
===================================================== */

.page-header {
  background: linear-gradient(135deg, #16a085, #2c3e50);
  color: white;
  padding: 60px 20px;
  text-align: center;
}

.page-header h1 {
  font-size: 2.8rem;
  margin-bottom: 15px;
}

.page-header p {
  font-size: 1.1rem;
  margin-bottom: 25px;
}

/* =====================================================
   MAIN
===================================================== */

main {
  padding: 20px 0;
}

/* =====================================================
   CARDS
===================================================== */

.card {
  background: white;
  border-radius: 14px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.08);
}

.card h2 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.card h3 {
  margin-bottom: 15px;
  color: #3498db;
}

/* =====================================================
   DESCRIPTION
===================================================== */

.section-description {
  margin-bottom: 20px;
  color: #666;
  line-height: 1.6;
}

/* =====================================================
   GRID
===================================================== */

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-group label {
  margin-bottom: 8px;
  font-weight: 600;
  color: #34495e;
}

.input-group input {
  padding: 12px;
  border: 1px solid #ccd1d9;
  border-radius: 8px;
  font-size: 1rem;
  transition: 0.2s;
}

.input-group input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* =====================================================
   BUTTONS
===================================================== */

.actions {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

/* =====================================================
   TABLE WRAPPER
===================================================== */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #dfe6e9;
  background: white;
}

/* =====================================================
   TABLE
===================================================== */

table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid #dfe6e9;
  text-align: center;
}

th {
  padding: 14px;
  background: #f8f9fa;
  color: #2c3e50;
  font-weight: 600;
}

/* =====================================================
   INPUTS INSIDE TABLE
===================================================== */

td {
  padding: 0;
}

td input {
  width: 100%;
  height: 100%;
  min-height: 52px;

  border: none;
  border-radius: 0;

  padding: 12px;

  text-align: center;
  font-size: 1rem;

  background: transparent;

  box-sizing: border-box;
  transition: 0.2s;
}

td input:focus {
  outline: none;
  background: #eef7ff;
}

/* =====================================================
   INITIAL VECTOR
===================================================== */

#initialVectorContainer {
  width: 100%;
  overflow-x: auto;
}

#initialVectorContainer table {
  width: auto;
  min-width: 300px;
  border-collapse: collapse;
}

#initialVectorContainer th,
#initialVectorContainer td {
  border: 1px solid #dfe6e9;
  text-align: center;
}

#initialVectorContainer th {
  padding: 14px;
  background: #f8f9fa;
}

#initialVectorContainer td {
  padding: 0;
}

#initialVectorContainer input {
  width: 100%;
  min-width: 90px;
  min-height: 52px;

  border: none;
  border-radius: 0;

  padding: 12px;

  text-align: center;
  font-size: 1rem;

  box-sizing: border-box;
}

#initialVectorContainer input:focus {
  outline: none;
  background: #eef7ff;
}

/* =====================================================
   RESULT BLOCKS
===================================================== */

.result-block {
  margin-bottom: 30px;
  padding: 20px;
  background: #fafafa;
  border-left: 5px solid #3498db;
  border-radius: 8px;
}

.result-block:last-child {
  margin-bottom: 0;
}

/* =====================================================
   FORMULAS
===================================================== */

.formula-block {
  overflow-x: auto;
  font-size: 1.15rem;
  line-height: 1.8;
}

.formula-block p {
  margin: 15px 0;
}

/* =====================================================
   GRAPH
===================================================== */

#graphContainer {
  width: 100%;
  overflow-x: auto;
  text-align: center;
}

/* =====================================================
   CHART
===================================================== */

#dtmcChart {
  width: 100% !important;
  max-height: 500px;
}

/* =====================================================
   FOOTER
===================================================== */

footer {
  margin-top: 50px;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 768px) {
  .page-header h1 {
    font-size: 2rem;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .actions .btn {
    width: 100%;
  }
}

/* =====================================================
   RANGE SLIDER
===================================================== */

input[type="range"] {
  width: 100%;
  cursor: pointer;
}

#precisionValue {
  font-weight: bold;
  color: #3498db;
  margin-left: 5px;
}

/* =====================================================
   GRAPH DOWNLOAD CONTROLS
===================================================== */

.graph-download-controls {
  display: flex;

  align-items: center;

  gap: 12px;

  flex-wrap: wrap;

  margin-top: 20px;
}

.graph-download-controls label {
  font-weight: 600;
}

.graph-download-controls select {
  width: 120px;
}

/* =====================================================
   MODEL ACTIONS
===================================================== */

.model-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.model-actions .btn {
  padding: 8px 16px;
}

/* =====================================================
   EXAMPLE MODELS
===================================================== */

.example-models {
  display: flex;

  align-items: center;

  gap: 10px;

  flex-wrap: wrap;

  margin-top: 15px;
}

.example-models select {
  min-width: 220px;
}
