:root {
    --primary-red: #d32f2f;
    --primary-green: #2e7d32;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
    color: #333;
    /* Removed grid background to make snow visible */
    background: #1a1a2e;
    /* Darker background for snow contrast */
    color: #fff;
    /* Light text for dark background */
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    /* Wider container */
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 95vh;
}

header h1 {
    font-family: 'Mountains of Christmas', cursive;
    color: #ff5252;
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

header p {
    color: #e0e0e0;
}

header {
    flex: 0 0 auto;
}

main#app {
    display: flex;
    flex: 1 1 auto;
    gap: 20px;
    overflow: hidden;
    /* Prevent scrolling on body, scroll inside if needed */
    text-align: left;
}

.input-section {
    flex: 0 0 350px;
    /* Fixed width for inputs */
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#results-section {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px;
    overflow-y: auto;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    /* Slightly transparent */
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    color: #333;
}

h2 {
    color: var(--primary-green);
    margin-top: 0;
}

.input-group,
.constraint-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: center;
    align-items: center;
}

input[type="text"],
select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    font-weight: 500;
    transition: transform 0.1s;
}

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

.btn-add {
    background-color: #e0e0e0;
    color: #333;
    width: 100%;
    margin-top: 10px;
}

.btn-remove {
    background-color: #ffcdd2;
    color: #c62828;
    padding: 10px 15px;
}

.btn-generate {
    background-color: var(--primary-red);
    color: white;
    font-size: 1.2rem;
    padding: 15px 30px;
    width: 100%;
    margin-top: 20px;
    box-shadow: 0 4px 0 #b71c1c;
}

.btn-generate:active {
    box-shadow: 0 0 0 #b71c1c;
    transform: translateY(4px);
}

.btn-reset {
    background-color: var(--primary-green);
    color: white;
    margin-top: 20px;
}

.btn-copy {
    background-color: #2196f3;
    color: white;
    margin-top: 5px;
}

.hidden {
    display: none !important;
}

/* Adjust card margins in input section */
.card {
    margin-bottom: 0;
}

#graph-container {
    flex: 1 1 auto;
    min-height: 400px;
    width: 100%;
    border: 2px dashed #ddd;
    border-radius: 12px;
    background: white;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    main#app {
        flex-direction: column;
        overflow: visible;
    }

    .input-section {
        flex: none;
        width: 100%;
    }

    .container {
        height: auto;
    }

    #graph-container {
        height: 60vh;
        /* Taller on mobile */
        min-height: 500px;
    }
}

.hint-text {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 10px 0;
    font-size: 0.9rem;
}

.error {
    color: #ff5252;
    margin-top: 10px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 4px;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.btn-import {
    background-color: #9c27b0;
    color: white;
    flex: 1;
}

.btn-copy {
    flex: 1;
    margin-top: 0;
    /* Reset margin since it's in flex row */
    background-color: #2196f3;
    /* Keep original background */
    color: white;
    /* Keep original color */
}

#markdown-output {
    width: 100%;
    height: 100px;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-family: monospace;
    margin-bottom: 5px;
    box-sizing: border-box;
    /* Make it look editable */
    background-color: white;
    cursor: text;
}

.pairs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.pair-item {
    background: white;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    font-size: 1.1rem;
    color: #333;
}

.export-section {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    color: #fff;
}

.export-section h3 {
    margin-top: 0;
    color: #444444;
}

#markdown-output {
    width: 100%;
    height: 100px;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-family: monospace;
    margin-bottom: 5px;
    box-sizing: border-box;
    color: #333;
}

/* Snow Effect */
#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: #fff;
    font-size: 1em;
    font-family: Arial;
    text-shadow: 0 0 1px #000;
    animation-name: fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) translateX(0);
    }

    100% {
        transform: translateY(110vh) translateX(20px);
    }
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.btn-shuffle {
    background-color: #ff9800;
    color: white;
    font-size: 1.1rem;
    padding: 10px 20px;
    box-shadow: 0 4px 0 #f57c00;
}

.btn-shuffle:active {
    box-shadow: 0 0 0 #f57c00;
    transform: translateY(4px);
}