/* style.css */
:root {
    --primary: #18259c;
    --secondary: #1632af;
    --success: #4CAF50;
    --warning: #FFC107;
    --danger: #F44336;
    --glass: rgba(255, 255, 255, 0.97);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --text-color-secondary: #666;
    --input-border: 1px solid rgba(25, 23, 167, 0.15);
    --input-focus-shadow: 0 0 0 3px rgba(25, 23, 167, 0.1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #090c36 0%, #0c4258 100%);
    min-height: 100vh;
    padding: 40px 20px;
    animation: gradientFlow 15s ease infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--glass);
    padding: 40px;
    border-radius: 25px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.container:hover {
    transform: translateY(-5px);
}

/* University Header */
.university-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    animation: slideIn 0.8s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.esgee-logo {
  width: 72px;
  height: 30px;
  display: flex;
  align-items: center;
  margin: 1.5rem auto;
}

.logo:hover {
    transform: rotate(15deg) scale(1.1);
}

h1 {
    font-size: 2.2em;
    margin-bottom: 25px;
    color: var(--primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Module Row */
.module-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    animation: moduleAppear 0.5s ease;
}

@keyframes moduleAppear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Input Styles */
.module-row input {
    padding: 10px 12px;
    font-size: 0.9em;
    border-radius: 8px;
    border: var(--input-border);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.module-row input:focus {
    border-color: var(--primary);
    box-shadow: var(--input-focus-shadow);
    background: white;
}

.module-row input::placeholder {
    font-size: 0.85em;
    opacity: 0.7;
}

.module-row input[type="number"]:valid {
    background: #f8fff9;
    color: var(--primary);
    font-weight: 500;
}

/* Input Order and Sizes */
.module-name { flex: 2 1 200px; }
.module-coeff { flex: 1 1 80px; }
.module-exam { flex: 1 1 120px; }
.module-cc { flex: 1 1 120px; }
.module-tp { flex: 1 1 120px; }

.module-tp:disabled {
    background: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed;
}

/* Delete Button */
.delete-btn {
    width: 24px;
    height: 24px;
    padding: 4px;
    border-radius: 4px;
    background: #ff4444;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: static;
    right: 10px;
    top: 50%;
    right: 8px;  /* Adjusted position */
    margin-left: 12px;  /* Added spacing */
    transform: none;
}

.delete-btn:hover {
    background: #cc0000;
    transform: translateY(-50%) scale(1.1);
}

.delete-btn svg {
    width: 14px;
    height: 14px;
    fill: white;
}

/* Actions */
.actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    border: #203244;
    border-radius: 20px;
}

/* Button */
button {
    display: inline-block;
    background: var(--primary, #2C3E50); 
    color: white;
    padding: 12px 35px;
    border-radius: 10px;
    border: 2px solid rgba(0,0,0,0.1);
    cursor: pointer;
    font-size: 0.95em;
    transition: background 0.2s ease, transform 0.1s ease;
}

button:hover {
    background: var(--primary-hover, #0a4f91);
    transform: translateY(-2px);
}

button:active {
    transform: scale(0.95);
}

/* Results Section */
.results {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    margin-top: 30px;
    font-size: 0.9em;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    0% { left: -100% }
    100% { left: 200% }
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin: 8px 0;
    border-radius: 10px;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.result-item:hover {
    transform: scale(1.02);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.average {
    font-size: 1.1em;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.total-average {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    font-size: 1.3em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.result-details {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.8em;
    color: var(--text-color-secondary);
}

.result-details span {
    padding: 5px 10px;
    border-radius: 5px;
    background: rgba(108, 99, 255, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }

    .container {
        padding: 25px;
        border-radius: 20px;
    }

    .university-header {
        margin-bottom: 20px;
        gap: 10px;
    }

    .logo {
        width: 60px;
        height: 60px;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    .module-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .module-row input {
        flex: 1 1 100%;
    }

    .delete-btn {
        position: static;
        transform: none;
        margin-top: 8px;
    }

    .actions {
        margin: 15px 0;
        gap: 10px;
    }

    button {
        padding: 10px 25px;
        font-size: 0.9em;
    }

    .results {
        padding: 15px;
        margin-top: 20px;
        border-radius: 10px;
        font-size: 0.85em;
    }

    .result-item {
        padding: 10px;
        margin: 6px 0;
    }

    .average {
        font-size: 1em;
        padding: 5px 10px;
    }

    .total-average {
        padding: 12px;
        margin-top: 15px;
        font-size: 1.2em;
        border-radius: 6px;
    }

    .result-details {
        font-size: 0.75em;
        gap: 8px;
    }
}

/* Floating Particles Background (You'll need to add the JavaScript for this) */
.particles {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
}
.module-tp:disabled {
    background: #f8f9fa !important;
    color: #6c757d !important;
}

.module-tp:disabled::placeholder {
    color: #6c757d;
    font-style: italic;
    content: "N/A";
}
.module-tp-container {
    display: flex;
    align-items: center;
    gap: 12px;  /* Increased gap */
    flex: 1 1 120px;
}
.module-row {
    transition: all 0.3s ease, transform 0.2s ease;
}

/* Loading animation */
@keyframes pulse {
    0% { opacity: 0.5; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

.loading {
    animation: pulse 1s infinite;
}
/* Results table styling */
.result-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-family: sans-serif;
}
.result-table thead {
  background: #2C3E50;
  color: white;
}
.result-table th,
.result-table td {
  padding: 0.75em;
  text-align: center;
  border: 1px solid #ddd;
}
.result-table tbody tr:nth-child(even) {
  background: #f9f9f9;
}
.result-table tbody tr:hover {
  background: #f1f1f1;
}

/* Emphasize “CC for 10” column */
.result-table th:nth-last-child(1),
.result-table td:nth-last-child(1) {
  background: #ff6c28;
  color: #ffffff;
  font-weight: bold;
}

/* Total average banner */
#results .total-avg {
  margin-top: 1rem;
  padding: 0.75em;
  color: white;
  font-weight: bold;
  text-align: center;
  border-radius: 4px;
}

/* Button styles */
.controls button {
  background: #2C3E50;
  color: white;
  border: none;
  padding: 0.5em 1em;
  margin-right: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}
.controls button:hover {
  background: #34495e;
}
.copy-right {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    color: #0a4f91;
}