/* Main Styles for Dissolution Profile Calculator */
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #E8F8F5 0%, #D5F3EF 50%, #C3EDE8 100%);
    color: #1a1a1a;
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 500;
}

/* Container styling to match Assay calculator */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(78, 205, 196, 0.15);
    padding: 30px;
    border: 1px solid rgba(78, 205, 196, 0.2);
    backdrop-filter: blur(20px);
}

/* Optimize Injection/Reading table cell widths */
#readingResultsTable {
    table-layout: fixed;
    width: 100%;
}

#readingResultsTable th,
#readingResultsTable td {
    padding: 3px 4px;
    font-size: 0.8rem;
    min-width: 60px;
    max-width: 80px;
}

/* Time column - fixed width */
#readingResultsTable th:first-child,
#readingResultsTable td:first-child {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    font-weight: 600;
    background: linear-gradient(135deg, #F0F9F7, #E8F8F5);
}

/* Unit columns - distribute evenly across available space */
#readingResultsTable th:not(:first-child):not([colspan]),
#readingResultsTable td:not(:first-child):not([colspan]) {
    width: auto;
    min-width: 80px;
    max-width: none;
}

/* Style the header properly */
#readingResultsTable th[colspan] {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    font-weight: 600;
    text-align: center;
}

/* Input fields in reading table */
#readingResultsTable input {
    width: 95%;
    padding: 2px 3px;
    font-size: 0.75rem;
    min-width: 60px;
    max-width: none;
    color: #000000 !important;
}

/* Excel-like focus styling */
.excel-focus {
    background-color: #0078d4 !important;
    color: white !important;
    outline: 2px solid #0078d4 !important;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.3) !important;
}

/* Table navigation styling */
#readingResultsTable input:focus,
#drugReleaseTable input:focus {
    background-color: #e3f2fd !important;
    border: 2px solid #2196f3 !important;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.3) !important;
}

/* Optimize Drug Release table cell widths */
#drugReleaseTable {
    table-layout: fixed;
    width: 100%;
}

#drugReleaseTable th,
#drugReleaseTable td {
    padding: 3px 4px;
    font-size: 0.8rem;
    min-width: 60px;
    max-width: 80px;
    color: #0d0d0d;
    font-weight: 600;
}

/* Time column - fixed width */
#drugReleaseTable th:first-child,
#drugReleaseTable td:first-child {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    font-weight: 700;
    background: linear-gradient(135deg, #F0F9F7, #E8F8F5);
    color: #0d0d0d;
}

/* Unit columns - distribute evenly */
#drugReleaseTable th:not(:first-child):not([colspan]),
#drugReleaseTable td:not(:first-child):not([colspan]) {
    width: auto;
    min-width: 70px;
    max-width: none;
}

/* Statistics columns - optimized width */
#drugReleaseTable th:nth-last-child(-n+4),
#drugReleaseTable td:nth-last-child(-n+4) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    font-weight: 700;
    color: #0d0d0d;
}

/* Style the Drug Release table header */
#drugReleaseTable th[colspan] {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    font-weight: 600;
    text-align: center;
}

/* Input fields in drug release table */
#drugReleaseTable input {
    width: 95%;
    padding: 2px 3px;
    font-size: 0.75rem;
    min-width: 60px;
    max-width: none;
    color: #0d0d0d;
    font-weight: 600;
}

#drugReleaseTable input[readonly] {
    color: #0d0d0d;
    font-weight: 700;
}

/* Ensure tables use full container width */
#readingResultsTable,
#drugReleaseTable {
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Add space between reading table and drug release table */
#readingResultsTable {
    margin-bottom: 30px !important;
}

h2 {
    text-align: center;
    margin: 0 0 30px 0;
    font-size: 2.2rem;
    font-weight: 800;
    color: #0d0d0d;
    line-height: 1.3;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.1);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #B2DFDB;
    table-layout: auto;
    border-spacing: 0;
}

th, td {
    border: 1px solid #E0F2F1;
    padding: 4px 6px;
    text-align: center;
    vertical-align: middle;
    height: auto;
    line-height: 1.3;
    min-width: 80px;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    color: #1a1a1a;
}

tr:nth-child(even) {
    background-color: #F8FDFC;
}

tr:hover {
    background-color: #E8F8F5;
    transition: background-color 0.3s ease;
}

input {
    width: 98%;
    padding: 4px 6px;
    text-align: center;
    border: 2px solid #B2DFDB;
    border-radius: 4px;
    transition: all 0.3s ease;
    background-color: #ffffff;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0d0d0d;
    outline: none;
    line-height: 1.2;
    min-width: 75px;
    box-sizing: border-box;
}

input:focus {
    border-color: #4ECDC4;
    outline: none;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
    transform: scale(1.02);
}

/* Excel-like focus styling */
.excel-focus {
    border-color: #2196F3 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3) !important;
    background-color: #E3F2FD !important;
    transform: scale(1.01) !important;
    position: relative;
}

.excel-focus::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #2196F3;
    border-radius: 6px;
    pointer-events: none;
    z-index: 1;
}

/* Excel-like cell selection */
input:focus,
select:focus {
    border-color: #2196F3;
    outline: none;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
    background-color: #E3F2FD;
    transform: scale(1.01);
}

/* Excel-like table row highlighting */
tr:hover {
    background-color: #F5F5F5;
    transition: background-color 0.2s ease;
}

/* Excel-like active row */
tr:has(.excel-focus) {
    background-color: #E8F4FD;
}

/* Excel-like cell position indicator */
.excel-focus {
    position: relative;
}

.excel-focus::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 2px solid #2196F3;
    border-radius: 4px;
    pointer-events: none;
    z-index: 2;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Excel-like navigation hints */
input::placeholder {
    color: #999;
    font-style: italic;
}

/* Excel-like input styling for better UX */
input[type="number"],
input[type="text"] {
    text-align: center;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Excel-like select styling */
select {
    text-align: center;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Excel-like status bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 16px;
    margin-top: 20px;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-bar span {
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.7);
}

#cellInfo {
    font-weight: 700;
    color: #0d47a1;
}

#navigationHelp {
    font-style: italic;
    color: #424242;
    font-weight: 500;
}

/* Excel-like validation error styling */
.validation-error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3) !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Excel-like input validation */
input:invalid {
    border-color: #dc3545;
    background-color: #f8d7da;
}

/* Excel-like tooltip for validation */
input[title] {
    position: relative;
}

input[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
}

input[readonly] {
    background-color: #F0F9F7;
    color: #5a7a7a;
    border-color: #B2DFDB;
}

select {
    width: 95%;
    padding: 8px;
    text-align: center;
    border: 2px solid #B2DFDB;
    border-radius: 8px;
    background-color: white;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    color: #0d0d0d;
}

/* Specific styling for apparatus dropdown to accommodate longer names */
select[name="apparatus"] {
    width: 100%;
    min-width: 180px;
    text-align: left;
    padding-left: 12px;
}

/* Ensure apparatus cell has enough width */
td:has(select[name="apparatus"]) {
    min-width: 200px !important;
    width: auto !important;
}

/* Make apparatus header cell narrow */
.apparatus-header {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    white-space: nowrap;
}

select:focus {
    border-color: #4ECDC4;
    outline: none;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

.section-header {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

button {
    padding: 12px 24px;
    margin-right: 12px;
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
}

button:hover {
    background: linear-gradient(135deg, #44A08D, #2E8B8B);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(78, 205, 196, 0.4);
}

button[type="reset"] {
    background: linear-gradient(135deg, #FF6B6B, #FF5252);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

button[type="reset"]:hover {
    background: linear-gradient(135deg, #FF5252, #F44336);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.4);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.3);
}

button[type="reset"] {
    background: linear-gradient(135deg, #FF6B6B, #FF5252);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

button[type="reset"]:hover {
    background: linear-gradient(135deg, #FF5252, #F44336);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.4);
}

#exportBtn {
    background: linear-gradient(135deg, #26D0CE, #1A9E9C);
    box-shadow: 0 4px 16px rgba(38, 208, 206, 0.3);
}

#exportBtn:hover {
    background: linear-gradient(135deg, #1A9E9C, #147B7A);
    box-shadow: 0 8px 24px rgba(38, 208, 206, 0.4);
}



/* Real-time calculation indicator */
#calculationIndicator {
    text-align: center;
    padding: 12px;
    margin: 15px 0;
    background: linear-gradient(135deg, #E8F8F5, #D5F3EF);
    border: 2px solid #4ECDC4;
    border-radius: 12px;
    color: #2d4a4a;
    font-style: italic;
    font-weight: 500;
}

/* Control buttons container */
form > div {
    text-align: center;
    margin-top: 25px;
    margin-bottom: 35px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    body {
        margin: 10px;
        padding: 10px;
    }
    
    .container {
        padding: 20px 15px;
        border-radius: 16px;
    }
    
    h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    input {
        width: 90%;
        padding: 8px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    th, td {
        padding: 6px 4px;
        font-size: 0.85rem;
        min-width: 60px;
    }
    
    /* Make tables scrollable horizontally on mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        border-radius: 8px;
    }
    
    button {
        padding: 10px 16px;
        font-size: 0.9rem;
        margin: 8px 4px;
    }
    
    .export-options {
        display: block;
        margin: 10px 0;
        padding: 12px;
    }
    
    .export-options label {
        display: block;
        margin: 8px 0;
    }
}

@media screen and (max-width: 480px) {
    body {
        margin: 5px;
        padding: 5px;
    }
    
    .container {
        padding: 15px 10px;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    input {
        width: 85%;
        padding: 6px;
        font-size: 16px;
    }
    
    th, td {
        padding: 4px 2px;
        font-size: 0.8rem;
        min-width: 50px;
    }
    
    button {
        padding: 8px 12px;
        font-size: 0.85rem;
        margin: 6px 2px;
    }
}

/* Add your custom styles below */
body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f0f8ff;  /* Very light blue (AliceBlue) */
}

h2 {
    color: #333;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

input[type="text"], input[type="number"], select {
    width: 95%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

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

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

input[readonly] {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
}

.section-header td {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
}

button {
    padding: 10px 15px;
    margin: 10px 5px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #45a049;
}

#calculationIndicator {
    margin: 15px 0;
    padding: 10px;
    background-color: #f2f2f2;
    border-left: 5px solid #4CAF50;
    font-style: italic;
}

.min-value {
    font-style: italic;
    color: #0056b3;
    font-weight: 500;
}

.max-value {
    font-style: italic;
    color: #dc3545;
    font-weight: 500;
}

/* Export options styling */
.export-options {
    display: inline-block;
    margin: 0 15px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 2px solid #B2DFDB;
    backdrop-filter: blur(10px);
}

.export-options span {
    margin-right: 12px;
    font-weight: 600;
    color: #2d4a4a;
}

.export-options label {
    margin-right: 15px;
    cursor: pointer;
    color: #5a7a7a;
    font-weight: 500;
}

.export-options input[type="radio"] {
    width: auto;
    vertical-align: middle;
    margin-right: 5px;
    accent-color: #4ECDC4;
} 

/* FINAL OVERRIDE - Force black text for ALL inputs with maximum specificity */
html body .container form input,
html body .container form select,
html body .container form textarea,
html body .container table input,
html body .container table select,
html body .container table textarea {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    caret-color: #000000 !important;
}

/* ULTIMATE OVERRIDE - Force black text for ALL inputs regardless of any other rules */
input, input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="url"], select, textarea {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    -moz-text-fill-color: #000000 !important;
    -ms-text-fill-color: #000000 !important;
    caret-color: #000000 !important;
} 