/* =========================================
   Pendulum Lab – Main Stylesheet
   Demonstrates layout, colour, typography,
   and hover effects.                      
   ========================================= */

/* Google Font loaded in HTML */

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

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Consistent header and navigation */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

/* Hover effect on navigation links (meets project requirement) */
nav a:hover {
    border-bottom: 2px solid #3498db;
    color: #ffffff;
}

nav a.active {
    border-bottom: 2px solid #3498db;
    font-weight: 700;
}

/* Main content layout */
main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.cta-button {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    margin-top: 1rem;
    transition: background-color 0.3s;
}

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

.media-grid {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

figure {
    text-align: center;
}

figcaption {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.5rem;
}

/* Simulation canvas and controls */
.simulation-controls {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

canvas {
    display: block;
    margin: 0 auto;
    background: #fafafa;
    border-radius: 4px;
}

.js-demo {
    margin-top: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.output-text {
    margin-top: 0.8rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Form styling (Suggestions page) */
form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

label {
    display: block;
    margin: 1rem 0 0.3rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}

.consent {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.consent input[type="checkbox"] {
    margin-top: 0.3rem;
}

.success {
    background: #d4edda;
    padding: 1rem;
    border-radius: 4px;
    color: #155724;
    margin-bottom: 1rem;
}

.error {
    background: #f8d7da;
    padding: 1rem;
    border-radius: 4px;
    color: #721c24;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: #bdc3c7;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

/* Updated simulation panel layout */
.simulation-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.simulation-canvases {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.controls {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.new-pendulum-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.new-pendulum-form label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

.new-pendulum-form input,
.new-pendulum-form select {
    padding: 0.4rem;
    margin-top: 0.2rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#addPendulum {
    grid-column: span 2;
    margin-top: 0.5rem;
}

.pendulum-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.pendulum-item {
    background: #f0f4f8;
    padding: 0.8rem;
    border-radius: 5px;
    font-size: 0.9rem;
}

.pendulum-item label {
    display: inline-block;
    margin-right: 1rem;
}

.pendulum-item input {
    width: 80px;
    padding: 0.3rem;
}

.remove-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 1rem;
}

.remove-btn:hover {
    background-color: #c0392b;
}
