/* Global styles for the page */
body {
    background: linear-gradient(to bottom, #0a0a2a, #000000); /* Space-like gradient */
    color: #ffffff; /* White text for readability */
    font-family: 'Exo', sans-serif; /* Futuristic font */
    margin: 0;
    padding: 20px; /* Add padding for mobile */
    box-sizing: border-box;
    min-height: 100vh; /* Ensure body takes full viewport height */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align content at the top */
}

/* Centered calculator container with hexagonal shape */
.calculator-container {
    position: relative;
    max-width: 400px; /* Max width for larger screens */
    width: 100%; /* Full width on mobile */
    margin: 20px auto; /* Center with reduced top margin for mobile */
    background: #1e1e1e; /* Dark gray background */
    padding: 30px; /* Increased padding */
    border-radius: 10px; /* Fallback for browsers */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Soft shadow for depth */
}

/* Hexagonal border effect using pseudo-elements */
.calculator-container::before,
.calculator-container::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #00BFFF; /* Neon blue border */
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
    pointer-events: none; /* Prevent interaction with pseudo-elements */
}

/* Stylized title */
h1 {
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase; /* Uppercase for a bold, sci-fi look */
    letter-spacing: 2px; /* Spacing for style */
    text-shadow: 0 0 5px #00BFFF; /* Neon blue glow */
    font-size: 1.5rem; /* Adjusted for mobile */
    word-wrap: break-word; /* Prevent title overflow */
}

/* Toggle group for advanced options */
.toggle-group {
    margin-bottom: 20px;
    text-align: center;
}

.toggle-group label {
    display: inline-block;
    margin-right: 10px;
}

.toggle-group input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #2e2e2e;
    border: 1px solid #00BFFF;
    border-radius: 3px;
    cursor: pointer;
    vertical-align: middle;
}

.toggle-group input[type="checkbox"]:checked {
    background: #00BFFF;
    box-shadow: 0 0 5px #00BFFF;
}

/* Grouping for label-input pairs */
.input-group {
    margin-bottom: 15px; /* Spacing between groups */
}

/* Advanced option container */
.advanced-option {
    margin-top: 10px;
}

/* Labels */
label {
    display: block; /* Stack above inputs */
    margin-bottom: 5px; /* Spacing from input */
    word-wrap: break-word; /* Prevent label overflow */
}

/* Input fields */
input[type="number"] {
    width: 100%; /* Full width of container */
    padding: 10px; /* Comfortable padding */
    border: 1px solid #00BFFF; /* Neon blue border */
    border-radius: 5px; /* Rounded corners */
    background: #2e2e2e; /* Slightly lighter background */
    color: #ffffff; /* White text */
    box-shadow: 0 0 5px #00BFFF; /* Subtle glow effect */
    box-sizing: border-box; /* Prevent overflow */
    margin-bottom: 10px; /* Add spacing between inputs */
}

/* Desired input fields (red styling) */
input.desired-input {
    border: 1px solid #FF4040; /* Red border */
    box-shadow: 0 0 5px #FF4040; /* Red glow effect */
}

/* Calculate button */
button.calculate-button {
    width: 100%; /* Full width */
    padding: 10px; /* Comfortable padding */
    background: #00BFFF; /* Neon blue background */
    color: #ffffff; /* White text */
    border: none; /* No border */
    border-radius: 5px; /* Rounded corners */
    cursor: pointer; /* Hand cursor on hover */
    transition: box-shadow 0.3s; /* Smooth transition for hover effect */
}

/* Button hover effect */
button.calculate-button:hover {
    box-shadow: 0 0 10px #00BFFF; /* Intensified glow on hover */
}

/* Result display */
#result, #combinations {
    margin-top: 20px; /* Spacing from button */
    padding: 10px; /* Internal padding */
    background: #2e2e2e; /* Slightly lighter background */
    border-radius: 5px; /* Rounded corners */
    text-align: center; /* Centered text */
    min-height: 20px; /* Minimum height for visibility when empty */
    opacity: 0; /* Start hidden for animation */
    word-wrap: break-word; /* Prevent text overflow */
}

/* Class to trigger fade-in animation */
.fade-in {
    opacity: 1; /* Fully visible after animation */
    color: #ffffff;
}

/* Mobile responsiveness */
@media (max-width: 500px) {
    body {
        padding: 10px; /* Reduce padding on mobile */
    }
    .calculator-container {
        padding: 15px; /* Slightly less padding on mobile */
        margin: 10px auto; /* Adjust margin */
    }
    h1 {
        font-size: 1.2rem; /* Smaller title on mobile */
    }
    input[type="number"], button.calculate-button {
        font-size: 0.9rem; /* Adjust font size for mobile */
        padding: 8px; /* Smaller padding on mobile */
    }
    #result, #combinations {
        font-size: 0.9rem; /* Smaller text on mobile */
    }
    .toggle-group label {
        font-size: 0.9rem;
    }
    .toggle-group input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}