:root {
    --background-color: #FDFBF7; /* Soft cream */
    --text-color: #1E293B; /* Slate */
    --primary-accent: #0D9488; /* Teal */
    --secondary-accent: #FF6B6B; /* Coral */
    --border-color: #E8E5E0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 800px; /* Limit content width */
}

h1 {
    color: var(--primary-accent);
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 700;
}

.controls-container {
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

.input-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 400px; /* Adjust as needed */
}

.input-area label {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--primary-accent);
}

.input-area input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    color: var(--text-color);
    background-color: #fff;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    transition: border-color 0.3s ease;
}

.input-area input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-accent);
}

.button-group {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    justify-content: center;
    gap: 15px;
}

button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #fff; /* White text for buttons */
    background-color: var(--primary-accent); /* Default to teal */
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

#shuffle-btn {
    background-color: var(--secondary-accent); /* Coral for shuffle */
}

#shift-left-btn, #shift-right-btn {
    background-color: var(--secondary-accent); /* Teal for shifts */
}

.display-area {
    background-color: #ffebeb;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap; /* Allow elements to wrap */
    justify-content: center;
    gap: 15px;
    min-height: 80px; /* Ensure it has some height even when empty */
    align-items: center;
}

.array-element {
    background-color: var(--primary-accent);
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.array-element:hover {
    transform: translateY(-2px);
}

.back-home-btn {
    display: inline-block;
    margin-top: 40px;
    padding: 12px 30px;
    background: linear-gradient(to right, #FF6B6B, #EE5A6F); /* Coral gradient */
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3); /* Subtle shadow for gradient */
}

.back-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.5);
}