:root {
    --primary-color: #0084ff;    /* Wii blue */
    --secondary-color: #4eb3ff;  /* Lighter blue */
    --accent-color: #00b2ff;     /* Accent blue */
    --dark-bg: #f0f0f0;          /* Lighter off-white background */
    --light-bg: #ffffff;         /* White */
    --text-light: #ffffff;       /* White text */
    --text-dark: #2b2b2b;        /* Darker gray text */
    --neutral-gray: #d2d2d2;     /* Light gray */
    --danger-color: #ff3333;     /* Red for delete buttons */
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    --success-color: #3fcc79;    /* Green for positive actions */
    --border-radius: 15px;       /* Consistent border radius */
}

body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: 2rem;
}

header {
    background-color: var(--primary-color);
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-light);
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
    margin: 0;
}

button {
    background-color: var(--light-bg);
    color: var(--primary-color);
    border: none;
    padding: 0.7rem 1.4rem;
    margin: 0.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

button:hover {
    background-color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#newMonsterBtn {
    background-color: var(--success-color);
    color: var(--text-light);
}

#newMonsterBtn:hover {
    background-color: #36b36a;
}

#breedBtn {
    background-color: var(--primary-color);
    color: var(--text-light);
}

#breedBtn:hover {
    background-color: var(--secondary-color);
}

main {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 3fr 2fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

#laboratory, #selectedMonsters, #geneticsInfo {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--neutral-gray);
}

.monster-card {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--neutral-gray);
    width: 150px;
    margin: 10px;
}

.monster-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.delete-button {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: rgba(255, 51, 51, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.monster-card:hover .delete-button {
    opacity: 1;
}

.delete-button:hover {
    background-color: var(--danger-color);
    transform: scale(1.1);
}

.monster-info {
    padding: 0.8rem;
}

#monsterContainer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 15px;
    padding-bottom: 20px;
}

/* Adjust detail modal */
.modal-content {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 85%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--neutral-gray);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-dark);
    cursor: pointer;
}

.close-modal:hover {
    color: var(--primary-color);
}

/* Make the parent slots nicer */
.parent-slot {
    flex: 1;
    background-color: rgba(240, 240, 240, 0.5);
    height: 150px;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px dashed var(--neutral-gray);
    transition: all 0.3s ease;
    margin: 0.5rem;
}

#parentContainer {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Fix loading overlay */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(240, 240, 240, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: none;
    padding-bottom: 0.5rem;
    margin-top: 0;
}

/* Make genetic info more appealing */
.genetic-bar {
    height: 20px;
    background-color: var(--neutral-gray);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.genetic-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.genetic-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.traits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#breedingInstructions {
    background-color: rgba(0, 132, 255, 0.1);
    padding: 10px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .controls {
        margin-top: 1rem;
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
}