body {
    font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;
    background:lightgray;
    min-height:100vh;
    margin:0;
    color:#333;
}

.header-section {
    background:rgba(255,255,255,0.95);
    backdrop-filter:blur(10px);
    border-bottom:1px solid rgba(0,0,0,0.1);
    padding:12px 0;
    position:sticky;
    top:0;
    z-index:1000;
}

.page-title {
    font-size:1.5rem;
    font-weight:600;
    color:#1a2a6c;
    margin:0;
    display:flex;
    align-items:center;
    gap:10px;
}

.page-title i {
    color:#1a2a6c;
    font-size:1.3rem;
}

.page-description-section {
    background:rgba(255,255,255,0.9);
    border-radius:12px;
    padding:20px;
    margin:20px 0;
    box-shadow:0 4px 15px rgba(0,0,0,0.1);
}

.page-description-text {
    font-size:1.1rem;
    line-height:1.6;
    color:#495057;
    margin-bottom:15px;
}

.badges-container {
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.badge-item {
    background:linear-gradient(135deg,#1a2a6c,#b21f1f);
    color:white;
    padding:6px 12px;
    border-radius:20px;
    font-size:0.85rem;
    font-weight:500;
    display:flex;
    align-items:center;
    gap:6px;
    box-shadow:0 2px 5px rgba(0,0,0,0.2);
}

.unified-toolbar {
    background:rgba(255,255,255,0.98);
    border:1px solid rgba(0,0,0,0.08);
    border-radius:12px;
    box-shadow:0 4px 20px rgba(0,0,0,0.08);
    margin:20px 0;
    overflow:hidden;
    backdrop-filter:blur(10px);
}

.toolbar-header {
    background:linear-gradient(135deg,#f8f9fa 0%,#e9ecef 100%);
    padding:10px 20px;
    border-bottom:1px solid rgba(0,0,0,0.06);
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:15px;
}

.toolbar-title {
    font-weight:600;
    color:#495057;
    display:flex;
    align-items:center;
    gap:8px;
}

.toolbar-stats {
    display:flex;
    gap:20px;
    font-size:13px;
    color:#6c757d;
}

.stat-item {
    display:flex;
    align-items:center;
    gap:5px;
    font-weight:500;
}

.stat-value {
    background:rgba(26,42,108,0.1);
    color:#1a2a6c;
    padding:2px 8px;
    border-radius:12px;
    font-weight:600;
    min-width:30px;
    text-align:center;
}

.toolbar-content {
    padding:15px 20px;
    display:flex;
    flex-wrap:wrap;
    gap:15px;
    align-items:center;
    justify-content:space-between;
}

.scenario-section {
    display:flex;
    gap:10px;
    align-items:center;
}

.scenario-select {
    width:180px;
    height:36px;
    border:2px solid #dee2e6;
    border-radius:8px;
    padding:0 12px;
    font-size:14px;
    font-weight:500;
    transition:all 0.2s ease;
    background:rgba(26,42,108,0.1);
    border-color:#1a2a6c;
}

.scenario-select:focus {
    outline:none;
    border-color:#1a2a6c;
    box-shadow:0 0 0 3px rgba(26,42,108,0.1);
}

.operations-section {
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.toolbar-btn {
    height:36px;
    padding:0 16px;
    border:1px solid transparent;
    border-radius:8px;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
    display:flex;
    align-items:center;
    gap:6px;
    transition:all 0.2s ease;
    white-space:nowrap;
    min-width:80px;
    justify-content:center;
}

.toolbar-btn:hover {
    transform:translateY(-1px);
    box-shadow:0 4px 12px rgba(0,0,0,0.15);
}

.toolbar-btn:active {
    transform:translateY(0);
}

.toolbar-btn i {
    font-size:14px;
}

.btn-start {
    background:linear-gradient(135deg,#1a2a6c,#2c3e50);
    color:white;
    border-color:#1a2a6c;
}

.btn-step {
    background:linear-gradient(135deg,#27ae60,#2ecc71);
    color:white;
    border-color:#27ae60;
}

.btn-reset {
    background:linear-gradient(135deg,#6c757d,#495057);
    color:white;
    border-color:#6c757d;
}

.btn-demo {
    background:linear-gradient(135deg,#e67e22,#d35400);
    color:white;
    border-color:#e67e22;
}

.main-content {
    background:rgba(255,255,255,0.98);
    border-radius:12px;
    box-shadow:0 8px 25px rgba(0,0,0,0.08);
    margin:20px 0;
    overflow:hidden;
    backdrop-filter:blur(10px);
}

.content-grid {
    display:grid;
    grid-template-columns:1fr 350px;
    gap:0;
    min-height:600px;
}

.visualization-panel {
    padding:30px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    background:linear-gradient(135deg,#f8f9fa 0%,#e9ecef 100%);
}

.reader-writer-container {
    width:100%;
    max-width:900px;
    display:flex;
    flex-direction:column;
    gap:30px;
    margin-bottom:30px;
}

.shared-resource-section {
    border:3px solid #1a2a6c;
    border-radius:12px;
    background:rgba(255,255,255,0.9);
    padding:20px;
    min-height:150px;
}

.resource-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:15px;
    font-weight:600;
    font-size:1.1rem;
    color:#1a2a6c;
}

.resource-status {
    background:linear-gradient(135deg,#1a2a6c,#b21f1f);
    color:white;
    padding:8px 16px;
    border-radius:20px;
    font-weight:bold;
    font-size:1rem;
    min-width:100px;
    text-align:center;
}

.resource-status.busy {
    background:linear-gradient(135deg,#e74c3c,#c0392b);
}

.resource-visualization {
    position:relative;
    height:150px;
    border:2px dashed #1a2a6c;
    border-radius:8px;
    background:rgba(26,42,108,0.05);
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.resource-content {
    width:100%;
    padding:15px;
}

.data-entry {
    background:linear-gradient(135deg,#3498db,#2980b9);
    color:white;
    padding:8px 12px;
    border-radius:6px;
    margin:5px 0;
    font-size:0.9rem;
    font-weight:500;
    box-shadow:0 2px 4px rgba(0,0,0,0.1);
}

.resource-lock {
    position:absolute;
    top:10px;
    right:10px;
    font-size:1.5rem;
    color:#1a2a6c;
    opacity:0;
    transition:opacity 0.3s ease;
}

.resource-lock.active {
    opacity:1;
}

.processes-container {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
    margin-bottom:20px;
}

.process-group {
    border:2px solid #dee2e6;
    border-radius:10px;
    padding:15px;
    background:rgba(255,255,255,0.8);
}

.process-group.readers {
    border-color:#3498db;
    background:rgba(52,152,219,0.05);
}

.process-group.writers {
    border-color:#e74c3c;
    background:rgba(231,76,60,0.05);
}

.process-group h4 {
    margin:0 0 10px 0;
    font-size:1rem;
    font-weight:600;
}

.process-group.readers h4 {
    color:#3498db;
}

.process-group.writers h4 {
    color:#e74c3c;
}

.process-list {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.process-item {
    padding:6px 12px;
    border-radius:15px;
    font-size:12px;
    font-weight:600;
    color:white;
    cursor:pointer;
    transition:all 0.2s ease;
    min-width:60px;
    text-align:center;
}

.process-item:hover {
    transform:translateY(-2px);
    box-shadow:0 4px 8px rgba(0,0,0,0.2);
}

.process-item.reader {
    background:linear-gradient(135deg,#3498db,#5dade2);
}

.process-item.writer {
    background:linear-gradient(135deg,#e74c3c,#ec7063);
}

.process-item.waiting {
    opacity:0.6;
    animation:pulse 1.5s infinite;
}

.process-item.active {
    box-shadow:0 0 15px rgba(26,42,108,0.6);
    animation:glow 1s infinite alternate;
}

@keyframes pulse {
    0%,100% {
    opacity:0.6;
}

50% {
    opacity:1;
}


}

@keyframes glow {
    0% {
    box-shadow:0 0 15px rgba(26,42,108,0.6);
}

100% {
    box-shadow:0 0 25px rgba(26,42,108,0.9);
}


}

.semaphore-container {
    display:flex;
    justify-content:space-between;
    gap:15px;
    margin:20px 0;
    flex-wrap:wrap;
}

.semaphore-item {
    flex:1;
    min-width:150px;
    border:2px solid #1a2a6c;
    border-radius:10px;
    padding:15px;
    background:rgba(255,255,255,0.9);
    text-align:center;
}

.semaphore-label {
    font-weight:600;
    color:#1a2a6c;
    margin-bottom:10px;
    font-size:0.9rem;
}

.semaphore-value {
    background:linear-gradient(135deg,#1a2a6c,#b21f1f);
    color:white;
    padding:8px 16px;
    border-radius:20px;
    font-weight:bold;
    font-size:1.2rem;
    min-width:50px;
    text-align:center;
    display:inline-block;
}

.semaphore-value.negative {
    background:linear-gradient(135deg,#e74c3c,#c0392b);
}

.queue-section {
    margin-top:15px;
    padding:10px;
    border:1px solid #dee2e6;
    border-radius:8px;
    background:rgba(248,249,250,0.8);
}

.queue-header {
    font-size:0.9rem;
    font-weight:600;
    color:#495057;
    margin-bottom:8px;
}

.queue-items {
    display:flex;
    gap:5px;
    flex-wrap:wrap;
}

.queue-item {
    padding:4px 8px;
    background:#6c757d;
    color:white;
    border-radius:10px;
    font-size:11px;
    font-weight:600;
}

.info-panel {
    padding:20px;
    background:rgba(255,255,255,0.98);
    border-left:1px solid rgba(0,0,0,0.08);
    overflow-y:auto;
}

.info-section {
    margin-bottom:25px;
}

.info-section h3 {
    font-size:1.1rem;
    font-weight:600;
    color:#1a2a6c;
    margin-bottom:12px;
    display:flex;
    align-items:center;
    gap:8px;
}

.info-content {
    font-size:14px;
    line-height:1.6;
    color:#495057;
}

.info-content ul {
    margin:10px 0;
    padding-left:20px;
}

.info-content li {
    margin-bottom:5px;
}

.code-block {
    background:#f8f9fa;
    border:1px solid #e9ecef;
    border-radius:6px;
    padding:12px;
    font-family:'Courier New',monospace;
    font-size:13px;
    margin:10px 0;
    overflow-x:auto;
    white-space:pre;
}

.highlight {
    background:rgba(26,42,108,0.1);
    padding:2px 4px;
    border-radius:3px;
    font-weight:600;
}

.solution-tabs {
    margin-top:15px;
}

.tab-header {
    display:flex;
    border-bottom:1px solid #dee2e6;
    margin-bottom:15px;
}

.tab-button {
    padding:8px 16px;
    background:#f8f9fa;
    border:1px solid #dee2e6;
    border-bottom:none;
    border-radius:5px 5px 0 0;
    cursor:pointer;
    font-weight:500;
    color:#495057;
    transition:all 0.2s ease;
}

.tab-button.active {
    background:#1a2a6c;
    color:white;
    border-color:#1a2a6c;
}

.tab-button:hover:not(.active) {
    background:#e9ecef;
}

.tab-content {
    min-height:150px;
}

.tab-pane {
    display:none;
}

.tab-pane.active {
    display:block;
}

.diagram-container {
    display:flex;
    flex-direction:column;
    gap:15px;
    margin-top:15px;
}

.diagram-step {
    display:flex;
    gap:15px;
    align-items:flex-start;
}

.step-number {
    background:linear-gradient(135deg,#1a2a6c,#b21f1f);
    color:white;
    width:30px;
    height:30px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
    flex-shrink:0;
}

.step-content h4 {
    margin:0 0 5px 0;
    color:#1a2a6c;
    font-size:1rem;
}

.step-content p {
    margin:0;
    color:#6c757d;
    font-size:0.9rem;
}

.current-operation {
    margin-top:20px;
    padding:15px;
    background:rgba(26,42,108,0.1);
    border-radius:10px;
    text-align:center;
    font-weight:600;
    color:#1a2a6c;
    width:100%;
    max-width:900px;
}

@media (max-width:1200px) {
    .content-grid {
    grid-template-columns:1fr;
}

.info-panel {
    border-left:none;
    border-top:1px solid rgba(0,0,0,0.08);
}


}

@media (max-width:768px) {
    .toolbar-content {
    flex-direction:column;
    align-items:stretch;
}

.scenario-section,.operations-section {
    justify-content:center;
}

.processes-container {
    grid-template-columns:1fr;
}

.semaphore-container {
    flex-direction:column;
}

.diagram-step {
    flex-direction:column;
    gap:5px;
}


}

.executing {
    animation:execute 2s ease-in-out;
}

@keyframes execute {
    0% {
    transform:scale(1);
}

50% {
    transform:scale(1.1);
    background:#f39c12;
}

100% {
    transform:scale(1);
}


}

.status-indicator {
    display:inline-block;
    width:8px;
    height:8px;
    border-radius:50%;
    margin-right:5px;
}

.status-indicator.running {
    background:#27ae60;
    animation:pulse 1s infinite;
}

.status-indicator.waiting {
    background:#f39c12;
}

.status-indicator.blocked {
    background:#e74c3c;
}