body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f4f4f9;
    color: #333;
}

/* Add this to your CSS */
#curveModal .close {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 1001; /* Ensure it's above the chart */
    color: #666;
    font-size: 24px;
    transition: 0.2s;
  }
  
  #curveModal .close:hover {
    color: #e74c3c;
    transform: scale(1.2);
  }

h1 {
    text-align: center;
    color: #2c3e50;
    padding-top: 40px;
}

form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.training-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.training {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    position: relative;
    flex: 1 1 calc(25% - 15px);
    min-width: 250px;
    box-sizing: border-box;
    transition: transform 0.2s, box-shadow 0.2s;
}

.training:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.button-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.button-container button {
    flex: 1;
    max-width: 200px;
}

#clearDataButton {
    margin-left: auto;
    background-color: #e74c3c;
}

#clearDataButton:hover {
    background-color: #c0392b;
}

label {
    display: block;
    margin: 10px 0 5px;
}

input, select {
    width: 98%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #3498db;
    color: white;
    cursor: pointer;
}

button.remove {
    background-color: #e74c3c;
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
}

button:hover {
    opacity: 0.9;
}

#results {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.error {
    border-color: #e74c3c;
}

.name-error-message {
    color: #e74c3c;
}

.error-message {
    color: #e74c3c;
    font-size: 0.8em;
    margin-top: -8px;
    margin-bottom: 10px;
    display: none;
}

.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.tooltip-icon {
    color: #3498db;
    font-weight: bold;
}

.info-box, .results-explanation {
    background: #e8f4fc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.info-box h2, .results-explanation h3 {
    margin-top: 0;
    color: #2c3e50;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 70%;
    max-width: 700px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

#attributeCurve {
    width: 100%;
    height: 400px;
    margin-top: 20px;
}

.modal-description {
    margin-top: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.config-button-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.config-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.config-button:hover {
    background-color: rgba(0,0,0,0.1);
    transform: rotate(30deg);
}

.config-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    overflow: auto;
    z-index: 1000;
}

.config-content {
    background-color: #fefefe;
    margin: 70px auto 20px;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    overflow-x: hidden;
}

.config-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.config-tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}

.config-tab.active {
    border-bottom-color: #3498db;
    font-weight: bold;
}

.config-tab-content {
    display: none;
}

.config-tab-content.active {
    display: block;
}

.config-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.curve-button {
    float: inline-end;
    position: relative;
    bottom: 10px;
    padding-bottom: 10px;
    padding-left: 15px;
    padding-right: 15px;
}

.attribute-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.attribute-config {
    flex: 1 1 calc(50% - 10px);
    min-width: 400px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.coefficient-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 10px 0;
}

.coefficient-item {
    display: flex;
    gap: 10px;
    align-items: center;
}

.level-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.level-item input {
    flex: 1;
}

.level-item button {
    flex: 0 0 80px;
    background-color: #e74c3c;
}

.remove-attribute-btn{
    background-color: #e74c3c;
}

.add-attribute-btn{
    margin-top: 10px;
}

.add-coeff-btn{
    margin-top: 5px;
}

.config-textarea {
    width: 100%;
    height: 120px;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    resize: vertical;
}

.json-textarea {
    width: 100%;
    height: 250px;
    font-family: monospace;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    resize: vertical;
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.nav-btn.save {
    background-color: #2ecc71;
    color: white;
}

.nav-title {
    font-weight: bold;
    font-size: 1.2em;
}

.remove-coeff {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 5px;
}

.remove-level-btn{
    margin-bottom: 10px;
}

.config-text-button{
    margin-right: 10px;
    margin-top: 10px;
}

@media (max-width: 1200px) {
    .training {
        flex: 1 1 calc(33.33% - 15px);
    }
}

@media (max-width: 900px) {
    .training {
        flex: 1 1 calc(50% - 15px);
    }
}

@media (max-width: 768px) {
    .config-button-container {
        top: 10px;
        right: 10px;
    }
    
    .config-content {
        width: 95% !important;
        margin: 70px auto 20px !important;
        padding: 15px !important;
        overflow-x: hidden;
    }
    
    .attribute-config {
        min-width: 100% !important;
    }
    
    .json-textarea {
        height: 300px !important;
    }
    
    .training {
        flex: 1 1 100%;
    }
}

/* Privacy Banner */
.privacy-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(40, 40, 40, 0.95);
    color: white;
    padding: 15px;
    z-index: 10000;
    display: none;
  }
  
  .privacy-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
  }
  
  .privacy-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
  }
  
  .privacy-banner a {
    color: #3498db;
    text-decoration: underline;
  }
  
  .privacy-banner button {
    padding: 8px 20px;
    border-radius: 4px;
    border: 1px solid #fff;
    background: transparent;
    color: white;
    cursor: pointer;
  }
  
  .privacy-banner button:hover {
    background: rgba(255,255,255,0.1);
  }
  

  .privacy-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
  }
  
  .privacy-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 700px;
    position: relative;
    z-index: 1000;
  }


  .error {
    border: 2px solid #ff0000 !important;
  }
  
  .error-message {
    color: #ff0000;
    font-size: 0.9em;
    margin-top: 4px;
    display: none;
  }

  #notificationModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
}

#notificationModal .modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    width: 400px;
    text-align: center;
}

#notificationModal .close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 24px;
}


.page-footer {
    text-align: center;
    margin: 40px auto 20px;
    max-width: 50%;
    font-size: 0.85em;
    color: #718096; /* Subtle gray text */
    line-height: 1.4;
}

.page-footer p {
    margin: 0;
    padding: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .page-footer {
        max-width: 90%;
        font-size: 0.8em;
    }
}

.page-footer br + span {
    font-size: 0.75em;
    opacity: 0.7;
}

/* (Previous CSS remains exactly the same, just add these new styles at the end) */

.page-footer {
    text-align: center;
    margin: 40px auto 20px;
    max-width: 50%;
    font-size: 0.85em;
    color: #718096;
    line-height: 1.4;
}

.page-footer p {
    margin: 0;
    padding: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .page-footer {
        max-width: 90%;
        font-size: 0.8em;
    }
}

/* Add to config modal styles */
.config-section label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}

.config-section input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ui-text-config {
    margin-bottom: 20px;
}

.ui-text-config label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.ui-text-config input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

@media (max-width: 768px) {
    /* ... other responsive styles ... */

    #curveModal .modal-content {
        width: 95%;
        height: 80vh; /* Reduced from 85vh */
        margin: 5vh auto;
        padding: 15px;
        overflow-y: auto;
    }

    #attributeCurve {
        width: 100% !important;
        height: 40vh !important; /* Fixed height */
        min-height: 300px; /* Reduced min-height */
        margin-top: 10px;
    }

    .modal-description {
        margin-top: 10px;
        padding: 8px;
    }
}