* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #e5e5f7;
    background-image:  linear-gradient(#444cf7 2px, transparent 2px), linear-gradient(90deg, #444cf7 2px, transparent 2px), linear-gradient(#444cf7 1px, transparent 1px), linear-gradient(90deg, #444cf7 1px, #e5e5f7 1px);
    background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
    background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255);
    border-radius: 20px;
    box-shadow: 0 3px 5px rgba(0, 0, 0);
    overflow: hidden;
}

.header {
    background: #191970;
    color: white;
    padding: 25px 20px;
    text-align: center;
}

.header h1 {
    font-family: "Atma", system-ui;
    font-weight: 700;
    font-style: normal;
    font-size: 2.3rem;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.header p {
    opacity: 0.9;
    font-size: 1rem;
}

.calculator {
    padding: 25px;
}

.input-group {
    display: flex;
    margin-bottom: 20px;
}

.input-group input {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px 0 0 10px;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: #191970;
}

.input-group button {
    background: green;
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.input-group button:hover {
    background: green;
}

.grades-list {
    margin: 25px 0;
    max-height: 300px;
    overflow-y: auto;
}

.grade-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.3s ease-out;
    border-left: 4px solid #4a00e0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.grade-item .grade-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #191970;
}

.grade-item .delete-btn {
    background: #ff4757;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s;
}

.grade-item .delete-btn:hover {
    background: #ff2e43;
}

.result-container {
    background: #f1f2f6;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

#result-container {
  text-align: center;
}

.result-container h2 {
    color: #4a00e0;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

#average {
  display: inline-block;
  width: auto;
  margin: 0 auto 10px auto;
  float: none;
}

.average {
    font-size: 3rem;
    font-weight: bold;
    color: #191970;
    margin: 10px 0;
}

.status {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
}

.approved {
    background: #2ed573;
    color: white;
}

.failed {
    background: #ff4757;
    color: white;
}

.actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.actions button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.actions button:active {
    transform: scale(0.98);
}

.calculate-btn {
    background: #191970;
    color: white;
}

.reset-btn {
    background: yellow;
    color: black;
}

.actions button:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.empty-state {
    text-align: center;
    padding: 30px 0;
    color: #777;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ddd;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Nota final grande y destacada */
#average {
  font-size: 2.5rem;
  font-weight: bold;
  margin-right: 16px;
  vertical-align: middle;
  transition: color 0.3s, background 0.3s, border 0.3s, box-shadow 0.3s;
  display: inline-block;
  padding: 6px 22px;
  border-radius: 12px;
  border: 2px solid transparent;
  box-shadow: 0 0 8px transparent;
}

/* Estado general */
#status.status {
  font-size: 1.3rem;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
  display: inline-block;
  transition: background 0.3s, color 0.3s;
}

/* Aprobado */
#status.approved {
  background: #e0fbe0;
  color: #2d8f2d;
  border: 2px solid #2d8f2d;
  box-shadow: 0 0 8px #b6f5b6;
}

/* Reprobado */
#status.failed {
  background: #ffeaea;
  color: #d32f2f;
  border: 2px solid #d32f2f;
  box-shadow: 0 0 8px #ffd6d6;
}

#average.approved {
  color: #2d8f2d;
  background: #e0fbe0;
  border: 2px solid #2d8f2d;
  border-radius: 12px;
  padding: 6px 22px;
  box-shadow: 0 0 8px #b6f5b6;
  transition: background 0.3s, color 0.3s;
}

#average.failed {
  color: #d32f2f;
  background: #ffeaea;
  border: 2px solid #d32f2f;
  border-radius: 12px;
  padding: 6px 22px;
  box-shadow: 0 0 8px #ffd6d6;
  transition: background 0.3s, color 0.3s;
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .input-group input {
        padding: 12px;
        font-size: 1rem;
    }
    
    .input-group button {
        padding: 0 20px;
    }
    
    .grade-item {
        padding: 12px;
    }
    
    .grade-value {
        font-size: 1.1rem !important;
    }
    
    .average {
        font-size: 2.5rem;
    }
    
    .actions {
        flex-direction: column;
    }
}