.tools-parent-container .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.tools-parent-container {
    /* Header Styles */
}

.tools-parent-container .header {
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: white;
}

.tools-parent-container .header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tools-parent-container .header p {
    font-size: clamp(1rem, 3vw, 1.5rem);
    opacity: 0.9;
}

.tools-parent-container {
    /* Setup Form Styles */
}

.tools-parent-container .setup-form {
    display: flex;
    justify-content: center;
    width: 100%;
}

.tools-parent-container .form-card {
    background: white;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    border: 5px solid #ff6b6b;
}

.tools-parent-container .form-card h2 {
    text-align: center;
    color: #ff6b6b;
    margin-bottom: 30px;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.tools-parent-container .step {
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
}

.tools-parent-container .step-label {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: bold;
}

.tools-parent-container .step-number {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-right: 15px;
}

.tools-parent-container .step-text {
    flex: 1;
}

.tools-parent-container .fun-input,
.tools-parent-container .fun-select {
    width: 100%;
    padding: 15px 20px;
    border: 3px solid #4ecdc4;
    border-radius: 15px;
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
    color: #1e1e1e;
}

.tools-parent-container .fun-input:focus,
.tools-parent-container .fun-select:focus {
    outline: none;
    border-color: #ff6b6b;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);

    color: #1e1e1e;
}

.tools-parent-container small {
    display: block;
    margin-top: 8px;
    opacity: 0.8;
    font-size: clamp(0.8rem, 2vw, 1rem);
}

.tools-parent-container {
    /* Operators Grid */
}

.tools-parent-container .operators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.tools-parent-container .operator-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.tools-parent-container .operator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.tools-parent-container .operator-card input[type=checkbox] {
    display: none;
}

.tools-parent-container .operator-card input[type=checkbox]:checked+.operator-icon {
    transform: scale(1.2);
}

.tools-parent-container .operator-card input[type=checkbox]:checked~.operator-name {
    color: #ff6b6b;
    font-weight: bold;
}

.tools-parent-container .operator-icon {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 10px;
    transition: transform 0.3s ease;
    line-height: 1.5;
}

.tools-parent-container .operator-name {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: #333;
    font-weight: bold;
    transition: color 0.3s ease;
}

.tools-parent-container {
    /* Toggle Switch */
}

.tools-parent-container .toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-top: 15px;
}

.tools-parent-container .toggle-switch input[type=checkbox] {
    display: none;
}

.tools-parent-container .toggle-slider {
    min-width: 60px;
    display: block;
    height: 30px;
    background: #ccc;
    border-radius: 15px;
    position: relative;
    transition: background 0.3s ease;
    margin-right: 15px;
}

.tools-parent-container .toggle-slider::before {
    content: "";
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.tools-parent-container .toggle-switch input[type=checkbox]:checked+.toggle-slider {
    background: #4ecdc4;
}

.tools-parent-container .toggle-switch input[type=checkbox]:checked+.toggle-slider::before {
    transform: translateX(30px);
}

.tools-parent-container .toggle-text {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: bold;
}

.tools-parent-container {
    /* Create Button */
}

.tools-parent-container .create-button {
    width: 100%;
    padding: 20px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    font-family: inherit;
}

.tools-parent-container .create-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.tools-parent-container {
    /* Puzzle Display */
}

.tools-parent-container .puzzle-display {
    text-align: center;
}

.tools-parent-container .puzzle-header h2 {
    color: #ff6b6b;
    margin-bottom: 30px;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    display: flow-root;
    width: 100%;
}

.tools-parent-container .puzzle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    overflow-x: auto;
}

.tools-parent-container .math-squares-grid {
    display: inline-block;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 5px solid #4ecdc4;
    font-family: "Courier New", monospace;
    font-size: clamp(16px, 3vw, 20px);
    line-height: 1.5;
    min-width: 400px;
}

.tools-parent-container .puzzle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    min-height: 50px;
}

.tools-parent-container .puzzle-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(45px, 7vw, 65px);
    height: clamp(40px, 6vw, 55px);
    margin: 0 3px;
    border-radius: 8px;
    font-weight: bold;
    font-size: clamp(16px, 3.5vw, 20px);
    text-align: center;
}

.tools-parent-container .puzzle-cell.number {
    background-image: linear-gradient(135deg, #f7dca7 0%, #c98504 100%) !important;
    color: white;
    border: 2px solid #4ecdc4;
}

.tools-parent-container .puzzle-cell.blank {
    background: #f8f8f8;
    border: 2px dashed #999;
    color: #666;
}

.tools-parent-container .puzzle-cell.operator {
    background: transparent;
    color: #333;
    font-size: clamp(18px, 4vw, 26px);
    border: none;
    font-weight: bold;
}

.tools-parent-container .puzzle-cell.result {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    border: 2px solid #ff6b6b;
    margin-left: 15px;
}

.tools-parent-container .puzzle-cell.black {
    background: #333;
    color: #333;
    border: 2px solid #333;
}

.tools-parent-container .puzzle-cell.filled {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    animation: fillAnimation 0.5s ease;
}

@keyframes fillAnimation {
    0% {
        transform: scale(0.8);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.tools-parent-container {
    /* Control Buttons */
}

.tools-parent-container .puzzle-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tools-parent-container .control-button {
    padding: 15px 25px;
    border: none;
    border-radius: 15px;
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-width: 150px;
}

.tools-parent-container .show-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tools-parent-container .download-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.tools-parent-container .rebuild-btn {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
}

.tools-parent-container .control-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.tools-parent-container {
    /* Instructions */
}

.tools-parent-container .instructions {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 5px solid #ff6b6b;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.tools-parent-container .instructions h3 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: clamp(1.3rem, 4vw, 2rem);
    text-align: center;
}

.tools-parent-container .instruction-content p {
    margin-bottom: 15px;
    font-size: clamp(1rem, 3vw, 1.2rem);
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-weight: bold;
}

.tools-parent-container {
    /* Responsive Design */
}

@media (max-width: 768px) {
    .tools-parent-container .container {
        padding: 10px;
    }

    .tools-parent-container .form-card {
        padding: 20px;
        margin: 10px;
    }

    .tools-parent-container .operators-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tools-parent-container .puzzle-controls {
        flex-direction: column;
        align-items: center;
    }

    .tools-parent-container .control-button {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .tools-parent-container .operators-grid {
        grid-template-columns: 1fr;
    }

    .tools-parent-container .math-squares-grid {
        padding: 15px;
        font-size: 14px;
        min-width: 300px;
    }
}

.tools-parent-container {
    /* Loading Animation */
}

.tools-parent-container .loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.tools-parent-container {
    /* Success Animation */
}

.tools-parent-container .success-animation {
    animation: bounce 0.6s ease;
}

@keyframes bounce {

    0%,
    20%,
    60%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    80% {
        transform: translateY(-5px);
    }
}

.tools-parent-container {
    /* Ripple Effect */
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes successPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}