/* BumiWasesa - Minimal Readable Styling */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-style: italic;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.info-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.info-section h2 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.form-section h3 {
    color: #333;
    margin-bottom: 1rem;
}

.form-section h4 {
    color: #555;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #555;
}

.form-group input[type="number"],
.form-group input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-top: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.progress-bar-container {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem auto;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

@keyframes indeterminate {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(250%); }
    100% { transform: translateX(-100%); }
}

.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.results {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

.results h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.summary {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.summary h4 {
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
}

.stat-label {
    font-weight: 500;
    color: #555;
}

.stat-value {
    font-weight: 600;
    color: #667eea;
}

.plot-container {
    margin: 2rem 0;
}

.download-section {
    text-align: center;
    margin-top: 1rem;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #777;
    margin-top: 2rem;
}

/* Heat Source Styling */
.heat-source {
    background: #f9f9f9;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.source-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.source-header h5 {
    margin: 0;
    color: #667eea;
}

.btn-remove {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #fdd;
    border-color: #fbb;
}

.ellipse-params {
    background: #fff;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
    border: 1px solid #ddd;
}

#sources-container {
    margin-bottom: 1rem;
}

/* Tooltip Styling */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
}

.tooltip-text {
    visibility: hidden;
    width: 300px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Theory page link styling */
.theory-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
}

.theory-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.4);
}

/* Material properties table */
.material-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.material-table th,
.material-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #ddd;
}

.material-table th {
    background: #667eea;
    color: white;
    font-weight: 500;
}

.material-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.material-table tr:hover {
    background-color: #f0f0f0;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tooltip-text {
        width: 250px;
        margin-left: -125px;
    }
}
