@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica Neue', sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    color: #20b2aa;
    line-height: 1.5;
    padding: 10px;
    font-size: 14px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #e6e6e6;
}

.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #e8f9f8 0%, #d4f4f1 100%);
    border-bottom: 3px solid #5fd3d0;
}

.calculator-header h1 {
    color: #000000;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.navigation-buttons {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    transition: all 0.2s ease;
}

.home-btn {
    background: linear-gradient(135deg, #FF6B6B, #FF5252);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.home-btn:hover {
    background: linear-gradient(135deg, #FF5252, #E53E3E);
    transform: translateY(-2px);
}

.previous-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.3);
}

.previous-btn:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    transform: translateY(-2px);
}

.next-btn {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.3);
}

.next-btn:hover {
    background: linear-gradient(135deg, #44A08D, #3A9B8E);
    transform: translateY(-2px);
}

.separator {
    height: 3px;
    background: linear-gradient(90deg, #4ECDC4, #44A08D);
    margin: 0 0 1rem 0;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
}

.input-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #e8f9f8 0%, #d4f4f1 100%);
    border-bottom: 1px solid #d1ecf1;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: #000000;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
}

.input-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    background: white;
    color: #000000;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #5fd3d0;
    box-shadow: 0 0 0 2px rgba(95, 211, 208, 0.2);
    background-color: #ffffff;
}

.input-group input:hover {
    border-color: #5fd3d0;
    background-color: #ffffff;
}

.impurity-table {
    margin: 0;
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    border: 1px solid #d1ecf1;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

thead {
    background: #b3e0dd;
    color: #2d5a58;
    border-bottom: 2px solid #5fd3d0;
}

th, td {
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

th {
    font-weight: bold;
    font-size: 16px;
    color: #2d5a58;
    text-align: center;
    padding: 10px 15px;
}

tbody tr:hover {
    background: #f8f9fa;
}

td input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    background: #ffffff;
    color: #000000;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

td input:focus {
    outline: none;
    border-color: #5fd3d0;
    box-shadow: 0 0 0 2px rgba(95, 211, 208, 0.2);
    background-color: #ffffff;
}

td input:hover {
    border-color: #5fd3d0;
    background-color: #ffffff;
}

/* Hide number input spinners/arrows */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.ai-result, .spec-limit-result {
    font-weight: bold;
    color: #2d5a58;
    text-align: center;
}

.table-controls {
    padding: 15px 20px;
    background: #f8f9fa;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #d1ecf1;
}

.add-row-btn, .calculate-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.add-row-btn {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.3);
}

.add-row-btn:hover {
    background: linear-gradient(135deg, #44A08D, #3A9B8E);
    transform: translateY(-2px);
}

.calculate-btn {
    background: linear-gradient(135deg, #00897b, #00695c);
    box-shadow: 0 4px 16px rgba(0, 137, 123, 0.3);
}

.calculate-btn:hover {
    background: linear-gradient(135deg, #00695c, #004d47);
    transform: translateY(-2px);
}

.results-section {
    margin: 0;
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 0;
    border-left: none;
    box-shadow: none;
    border: 1px solid #d1ecf1;
    border-top: none;
}

.results-section h3 {
    background: #b3e0dd;
    border-bottom: 2px solid #5fd3d0;
    padding: 10px 15px;
    margin: -15px -20px 15px -20px;
    font-weight: bold;
    font-size: 16px;
    color: #2d5a58;
    text-transform: none;
}

.calculation-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 3px;
    border: 1px solid #d1ecf1;
}

.calculation-details p {
    margin-bottom: 12px;
    color: #2d5a58;
}

.calculation-step {
    margin-bottom: 12px;
    padding: 15px;
    background: #ffffff;
    border-radius: 3px;
    border-left: 3px solid #5fd3d0;
    border: 1px solid #d1ecf1;
}

.calculation-step strong {
    color: #2d5a58;
    font-weight: bold;
}

/* =============================================================================
   SECURITY PROTECTION MEASURES - CSS LAYER
   ============================================================================= */

/* Disable text selection globally, but allow in input fields */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Re-enable text selection for input fields */
input, textarea, [contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Disable drag and drop for images and other elements */
img, svg, video, audio, canvas {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Re-enable pointer events for interactive elements */
button, input, textarea, select, a, [role="button"] {
    pointer-events: auto !important;
}

/* Prevent highlighting of text */
::selection {
    background: transparent;
}

::-moz-selection {
    background: transparent;
}

/* Override selection for input fields only */
input::selection, textarea::selection {
    background: #4ECDC4 !important;
    color: white !important;
}

input::-moz-selection, textarea::-moz-selection {
    background: #4ECDC4 !important;
    color: white !important;
}

/* Disable context menu styling */
.no-context-menu {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Disable outline on focus for non-interactive elements */
*:not(input):not(textarea):not(button):not(select):not(a):focus {
    outline: none !important;
}

/* Hide scrollbars that might reveal content structure */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

/* Prevent zoom on mobile devices */
input[type="text"], 
input[type="number"], 
input[type="email"], 
input[type="password"], 
textarea, 
select {
    font-size: 16px !important;
    transform-origin: left top;
    transform: scale(1);
}

/* Hide any potential debug information */
.debug, .console, .inspector, .developer {
    display: none !important;
    visibility: hidden !important;
}

/* Protect against CSS injection */
[style*="position: fixed"],
[style*="position: absolute"],
[style*="z-index: 9999"],
[style*="display: none"] {
    position: static !important;
    z-index: 1 !important;
    display: block !important;
}

/* =============================================================================
   END SECURITY PROTECTION MEASURES
   ============================================================================= */

/* PDF Report Button Styling */
.pdf-report-section {
    margin: 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 0;
    border: 1px solid #d1ecf1;
    border-top: none;
    text-align: center;
}

.pdf-report-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #FF6B6B, #FF5252);
    color: white;
    min-width: 200px;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.pdf-report-btn:hover {
    background: linear-gradient(135deg, #FF5252, #E53E3E);
    transform: translateY(-2px);
}

.pdf-report-btn:active {
    transform: translateY(0);
}

.pdf-report-btn .icon {
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .navigation-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .table-controls {
        flex-direction: column;
    }
    
    .pdf-report-btn {
        min-width: auto;
        padding: 10px 20px;
        font-size: 14px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 10px 8px;
    }
}
