*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:Arial, sans-serif;
}

.container{
display:flex;
min-height:100vh;
}

.sidebar{
width:220px;
background:#2c3e50;
color:white;
transition:0.3s;
}

.sidebar ul{
list-style:none;
margin-top:20px;
}

.sidebar li{
padding:15px;
cursor:pointer;
border-bottom:1px solid rgba(255,255,255,0.1);
}

.sidebar li:hover{
background:#34495e;
}

.toggle-btn{
background:none;
border:none;
color:white;
font-size:20px;
padding:15px;
cursor:pointer;
}

.sidebar.collapsed{
width:60px;
}

.sidebar.collapsed ul{
display:none;
}

.content{
flex:1;
padding:30px;
}

button{
padding:10px 15px;
margin:10px 0;
cursor:pointer;
}

.tab{
display:none;
}

.tab.active{
display:block;
}

.dark-mode{
background:#121212;
color:white;
}

ul{
margin-top:10px;
}

@media(max-width:768px){

.sidebar{
position:fixed;
height:100%;
z-index:1000;
}

.content{
margin-left:60px;
padding:20px;
}

/* Exercise 4 Styles */
.grade-calculator {
  max-width: 500px;
  margin-top: 20px;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.grade-calculator h3 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.input-group {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.input-group label {
  width: 120px;
  font-weight: bold;
  color: #2c3e50;
}

.input-group input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

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

.button-group {
  margin: 20px 0;
  display: flex;
  gap: 10px;
}

.button-group button {
  flex: 1;
  padding: 10px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
}

.button-group button:hover {
  background: #2980b9;
}

.button-group .reset-btn {
  background: #95a5a6;
}

.button-group .reset-btn:hover {
  background: #7f8c8d;
}

.result-box {
  margin: 20px 0;
  padding: 20px;
  background: white;
  border-radius: 4px;
  border-left: 4px solid #3498db;
}

.result-item {
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
}

.result-label {
  width: 140px;
  font-weight: bold;
  color: #2c3e50;
}

.result-value {
  font-size: 24px;
  font-weight: bold;
  color: #2c3e50;
}

.grade-scale {
  margin-top: 20px;
}

.grade-scale h4 {
  margin-bottom: 10px;
  color: #2c3e50;
}

.grade-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 4px;
  overflow: hidden;
}

.grade-table th,
.grade-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.grade-table th {
  background: #34495e;
  color: white;
  font-weight: bold;
}

.grade-table tr:last-child td {
  border-bottom: none;
}

.grade-table tr:hover {
  background: #f5f5f5;
}

/* Dark mode support for Exercise 4 */
.dark-mode .grade-calculator {
  background: #2c3e50;
}

.dark-mode .grade-calculator h3,
.dark-mode .grade-calculator h4,
.dark-mode .input-group label,
.dark-mode .result-label {
  color: #ecf0f1;
}

.dark-mode .input-group input {
  background: #34495e;
  border-color: #4a6278;
  color: white;
}

.dark-mode .result-box {
  background: #34495e;
  border-left-color: #3498db;
}

.dark-mode .result-value {
  color: #ecf0f1;
}

.dark-mode .grade-table {
  background: #34495e;
}

.dark-mode .grade-table th {
  background: #2c3e50;
}

.dark-mode .grade-table td {
  border-bottom-color: #4a6278;
  color: #ecf0f1;
}

.dark-mode .grade-table tr:hover {
  background: #3d566e;
}

/* Responsive design for Exercise 4 */
@media (max-width: 768px) {
  .grade-calculator {
    padding: 15px;
  }
  
  .input-group {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .input-group label {
    width: 100%;
    margin-bottom: 5px;
  }
  
  .input-group input {
    width: 100%;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .result-item {
    flex-direction: column;
  }
  
  .result-label {
    width: 100%;
    margin-bottom: 5px;
  }
}
