@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap');
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}
        
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Poppins", sans-serif;
}
        
body {
    background-image: url('background.png');
	background-size: cover;
	background-position: center;
	background-attachment: fixed;
    color: var(--dark-color);
    line-height: 1.6;
}
        
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
        
header {
    background: radial-gradient(circle, #3a6fe4, #90ae8b);
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-bottom: 30px;
	border: 5px solid #000000;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
        
h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}
        
.generator-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}
        
.controls {
    flex: 1;
    min-width: 300px;
    background-color: white;
    padding: 25px;
	border: 5px solid #000000;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
        
.preview {
    flex: 2;
    min-width: 300px;
    background-color: white;
    padding: 25px;
	border: 5px solid #000000;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}
        
.form-group {
    margin-bottom: 20px;
}
       
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary-color);
}
        
input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}
        
input[type="checkbox"] {
    margin-right: 10px;
}
        
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
        
button {
    background: radial-gradient(circle, #3a6fe4, #90ae8b);
    color: #000000;
    border: none;
    padding: 12px 20px;
	border: 2px solid #000000;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s;
    margin-right: 10px;
    margin-bottom: 10px;
    width: 100%;
}
        
button:hover {
    background-color: var(--secondary-color);
}
        
.button-group {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
}
        
.worksheet-container {
    flex-grow: 1;
    margin-bottom: 20px;
    padding: 20px;
    border: 1px dashed #ccc;
    background-color: white;
    width: 100%;
}
        
.worksheet-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--primary-color);
}
        
.problems-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
        
.math-problem {
    padding: 10px;
    font-size: 18px;
    page-break-inside: avoid;
}
        
.answer-key {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--primary-color);
    page-break-before: always;
}
        
.answer-key-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--secondary-color);
}
        
.name-line, .date-line, .grade-line {
    margin-bottom: 15px;
}

.demo {
	text-align: center;
	color: maroon;
	}

@media print {
    body {
        background: white;
        padding: 0;
        margin: 0;
        }
    header, .controls, .button-group {
        display: none;
        }
    .worksheet-container {
        border: none;
        padding: 0;
        margin: 0;
        width: 100%;
        }
    .container {
        padding: 0;
        max-width: 100%;
        }
    .problems-container {
        grid-template-columns: repeat(2, 1fr) !important;
        }
    }

@media (max-width: 768px) {
    .generator-container {
        flex-direction: column;
    }
    .problems-container {
        grid-template-columns: 1fr;
    }
}