/* Main Stylesheet for 1D Poisson Simulator */

/* General Styles */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
}

main {
    min-height: calc(100vh - 200px);
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
}

.navbar-dark .navbar-nav .nav-link {
    transition: color 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #fff !important;
}

/* Cards */
.card {
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,.125);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,.125);
}

/* Buttons */
.btn {
    border-radius: 6px;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,.1);
}

/* Layer List */
.layer-item {
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.layer-item:hover {
    background-color: #f8f9fa;
}

.layer-item.active {
    background-color: #e7f3ff;
    border-left-color: var(--primary-color);
}

.layer-item .layer-material {
    font-weight: 600;
    color: #212529;
}

.layer-item .layer-thickness {
    color: #6c757d;
    font-size: 0.875rem;
}

.layer-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.layer-item:hover .layer-actions {
    opacity: 1;
}

/* Structure Preview */
#structurePreview {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
}

.layer-bar {
    height: 40px;
    display: inline-block;
    vertical-align: top;
    border: 1px solid #333;
    position: relative;
    transition: all 0.3s;
}

.layer-bar:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.layer-label {
    font-size: 0.75rem;
    text-align: center;
    margin-top: 4px;
}

/* Results Page */
.result-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.result-item:hover {
    background-color: #f8f9fa;
}

.plot-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.plot-container img {
    max-width: 100%;
    height: auto;
}

/* Materials Page */
.material-card {
    transition: all 0.2s;
}

.material-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.property-table {
    font-size: 0.875rem;
}

.property-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

/* Alerts */
.alert {
    border-radius: 6px;
}

/* Forms */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Utility Classes */
.text-monospace {
    font-family: 'Courier New', Courier, monospace;
}

.cursor-pointer {
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .layer-bar {
        display: block;
        width: 100% !important;
        margin-bottom: 5px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Code Display */
pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    overflow-x: auto;
}

code {
    color: #e83e8c;
}

/* Footer styles */
#footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

#version-text, #powered-text {
    font-size: 1.0rem;
    color: #e0e0e0;
}

#logo, #logotext {
    height: 25px;
    width: auto;
    vertical-align: middle;
}

#logo-container a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

/* Fixed header/footer layout */
body.d-flex {
    overflow: hidden;
}

.fixed-top + main {
    margin-top: 56px; /* standard Bootstrap navbar height */
}

footer {
    flex-shrink: 0;
}