:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --edf-color: #27ae60;
    --rma-color: #e74c3c;
    --text-color: #ecf0f1;
    --idle-color: rgba(200, 200, 200, 0.3);
    --background-gradient: linear-gradient(135deg, #1a2a3a, #2c3e50);
    --warning-color: #f39c12;
    --error-color: #e74c3c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-gradient);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

h1, h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-color);
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.input-group {
    margin-bottom: 30px;
    text-align: center;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
}

.input-group input {
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    font-size: 16px;
    width: 100px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
}

.generate-text {
    text-align: center;
    margin: 20px 0;
    font-size: 18px;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.algorithm-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#edfBtn {
    background-color: var(--edf-color);
    color: white;
}

#rmaBtn {
    background-color: var(--rma-color);
    color: white;
}

.algorithm-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.process-inputs {
    margin-bottom: 30px;
}

.process-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 5px;
}

.process-row label {
    font-weight: bold;
    min-width: 80px;
}

.process-row input {
    padding: 8px 12px;
    border-radius: 5px;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    width: 80px;
}

.simulation-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-container label {
    white-space: nowrap;
}

#arrivalTime {
    width: 200px;
}

.simulate-btn {
    padding: 12px 30px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.simulate-btn:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#gantt-container {
    margin-top: 40px;
    overflow-x: auto;
    padding: 20px 0;
}

.gantt-chart {
    display: flex;
    height: 60px;
    position: relative;
    background-color: rgba(255, 255, 255, 0.1);
    align-items: center;
}

.gantt-block {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    position: relative;
}

.idle-block {
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        var(--idle-color),
        var(--idle-color) 2px,
        transparent 2px,
        transparent 4px
    );
}

.gantt-time-scale {
    display: flex;
    margin-top: 10px;
    position: relative;
    height: 20px;
}

.gantt-time-tick {
    position: absolute;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--text-color);
    white-space: nowrap;
}

.back-btn {
    display: block;
    margin: 30px auto 0;
    padding: 10px 20px;
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--text-color);
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background: var(--background-gradient);
    margin: 15% auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
}

.close-btn:hover {
    color: var(--accent-color);
}

#modal-title {
    color: var(--warning-color);
    margin-bottom: 20px;
}

#modal-message {
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#proceedBtn {
    background-color: var(--warning-color);
    color: white;
}

#cancelBtn {
    background-color: var(--secondary-color);
    color: white;
}

.modal-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}
