html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    padding-bottom: 70px;
    background-color: #f5f5f5;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex: 1;
    box-sizing: border-box;
}

@media screen and (max-width: 900px) {
    .container {
        border-radius: none !important;
        box-shadow: none !important;
        background-color: rgba(255, 255, 255, 0);
    }
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-weight: normal;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-weight: normal;
}

a {
    color: #4a90e2;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header/Nav */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.header h1 {
    margin: 0;
    text-align: left;
    font-size: 24px;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-link {
    color: #666;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.2s;
    background-color: #f8f8f8;
}

.nav-link:hover {
    background-color: #eee;
    color: #333;
    text-decoration: none;
}

.nav-link.active {
    background-color: #4a90e2;
    color: white;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    background-color: #e0e0e0;
    color: #333;
}

.btn:hover {
    background-color: #d0d0d0;
    text-decoration: none;
}

.btn-primary {
    background-color: #4a90e2;
    color: white;
}

.btn-primary:hover {
    background-color: #357abd;
}

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

.btn-secondary:hover {
    border-color: #bbb;
    color: #333;
    background-color: #f9f9f9;
}

/* Form elements */
input[type="text"], input[type="datetime-local"], select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

input:focus, select:focus {
    outline: none;
    border-color: #4a90e2;
}

/* Tool Grid (Home Page) */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.tool-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 30px;
    transition: all 0.3s;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #4a90e2;
    background-color: #f0f7ff;
}

.tool-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.tool-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e0f0ff;
    color: #4a90e2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.tool-card h2 {
    margin: 0;
    font-size: 20px;
    text-align: left;
}

.tool-card p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    flex-grow: 1;
}

.tool-link {
    display: block;
    text-align: center;
    background-color: #4a90e2;
    color: white;
    padding: 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
    font-weight: 500;
    margin-top: auto;
}

.tool-link:hover {
    background-color: #357abd;
    text-decoration: none;
}

/* Data Analysis Tool Styles */
.upload-area {
    border: 2px dashed #ddd;
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    background-color: #fafafa;
    margin-bottom: 30px;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #4a90e2;
    background-color: #f0f7ff;
}

.upload-btn {
    background-color: #4a90e2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

.upload-btn:hover {
    background-color: #357abd;
}

#fileInput {
    display: none;
}

.file-label {
    cursor: pointer;
    display: block;
    margin-bottom: 15px;
    color: #666;
}

.charts-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.chart-box {
    height: 400px;
    width: 100%;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    background: #fff;
    box-sizing: border-box;
}

.loading {
    display: none;
    text-align: center;
    color: #666;
    margin: 20px 0;
}

.error-msg {
    color: #e74c3c;
    text-align: center;
    margin: 10px 0;
    display: none;
    padding: 10px;
    background: #fde8e7;
    border-radius: 4px;
}

/* Timeline Tool Styles */
.top-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Footer Styles */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    text-align: center;
    color: #888;
    font-size: 14px;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-content: center;
    align-items: center;
    z-index: 100;
}

.footer p {
    margin: 0;
}

.timeline-info {
    border: 1px solid #eee;
    background: #fafafa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.tl-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
}

.tl-name {
    color: #475569;
    font-weight: 600;
    font-size: 14px;
    text-align: right;
    padding-right: 10px;
}

.axis {
    position: relative;
    height: 60px;
    border: 1px solid #eee;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
}

.ticks {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to right, #e2e8f0 1px, transparent 1px);
    background-size: 10% 100%;
}

.labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.label {
    position: absolute;
    bottom: 5px;
    transform: translateX(-50%);
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

.events {
    position: absolute;
    inset: 0;
}

.ev {
    position: absolute;
    top: 12px;
    height: 26px;
    padding: 0 10px;
    border-radius: 4px;
    border: 1px solid #c7d2fe;
    background: #e0e7ff;
    color: #312e81;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    white-space: nowrap;
}

.ev:hover {
    background: #c7d2fe;
    z-index: 10;
}

/* Modal */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal {
    width: min(500px, 100%);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f8f8;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f8f8;
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

.close-modal:hover {
    color: #333;
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

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

th {
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    background: #f8fafc;
}

td {
    color: #334155;
    font-size: 14px;
}

/* Schedule Tool Specifics */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.section-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

input[type="file"] {
    width: min(520px, 100%);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 14px;
    margin-bottom: 0;
}
