@font-face {
    font-family: 'HamburgSymbols';
    src: url('/static/fonts/HamburgSymbols.ttf') format('truetype');
}

:root { --bg-color: #f0f0f0; --panel-bg: #ffffff; --border-color: #b0b0b0; --primary-color: #0078d4; --primary-hover: #0063b1; }
body { margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; background-color: var(--bg-color); overflow: hidden; height: 100vh; display: flex; flex-direction: column; }

.menu-bar { background-color: #f0f0f0; border-bottom: 1px solid var(--border-color); display: flex; padding: 2px 5px; font-size: 12px; }
.menu-item { padding: 2px 10px; cursor: default; position: relative; }
.menu-item:hover { background-color: #91c9f7; outline: 1px solid #3399ff; }

.main-container { display: flex; flex: 1; overflow: hidden; }
.chart-section { flex: 2.5; background-color: #ffffff; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.chart-section.zoomable { cursor: grab; }
.chart-section.zoomable:active { cursor: grabbing; }
.data-section { flex: 1; background-color: var(--panel-bg); overflow-y: auto; padding: 15px; font-size: 11px; display: flex; flex-direction: column; align-items: flex-end; }

.user-info-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    background: transparent;
    padding: 0;
    font-size: 12px;
    line-height: 1.4;
    z-index: 10;
    color: #333;
    pointer-events: none;
}
.info-sub { color: #777; font-size: 11px; margin-top: 4px; }
.eclipse-info { margin-top: 10px; font-size: 10px; color: #555; border-top: 1px solid #eee; padding-top: 8px; line-height: 1.5; }
.eclipse-title { font-weight: bold; color: #333; display: block; margin-bottom: 2px; }

/* Aspects Grid - Triangular */
.aspects-grid {
    position: absolute;
    bottom: 15px;
    left: 15px;
    border-collapse: collapse;
    background: transparent;
    z-index: 10;
}
.aspects-grid td {
    width: 22px;
    height: 22px;
    border: 1px solid #ccc;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
    background: #ffffff;
}
.aspects-grid td.empty {
    border: none;
    background: transparent;
}
.grid-header { background: #ffffff !important; font-weight: normal !important; }

#astroTooltip {
    position: absolute;
    display: none;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 2000;
    pointer-events: none;
}

/* Context Menu */
#planetContextMenu {
    position: absolute;
    display: none;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    z-index: 3000;
    min-width: 180px;
    font-size: 12px;
    padding: 5px 0;
}
.menu-header-item { padding: 5px 15px; border-bottom: 1px solid #eee; font-weight: bold; background: #f9f9f9; display: flex; align-items: center; gap: 8px; }
.menu-aspect-item { padding: 3px 15px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.menu-aspect-item:hover { background: #e8f4ff; }

.planet-list { list-style: none; padding: 0; margin: 0; width: 100%; }
.planet-item { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 1px 0; color: #000; }

.astro-font { font-family: 'HamburgSymbols', sans-serif; font-size: 16px; line-height: 1; }
.sym-p { color: #000; width: 18px; text-align: center; }
.sym-z { color: #000; width: 18px; text-align: center; }
.deg-val { color: #000; font-family: monospace; font-weight: normal; min-width: 50px; text-align: right; font-size: 11px; }
.retro-r { color: #000; font-weight: bold; font-size: 0.8em; width: 10px; text-align: center; }

/* Chains Section */
.chains-container { margin-top: 20px; width: 100%; }
.chain-box { margin-bottom: 10px; display: flex; flex-direction: column; align-items: flex-end; }
.chain-title { font-weight: bold; font-size: 10px; color: #999; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

.graph-wrapper {
    width: 100%;
    min-height: 80px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: transparent;
}
.graph-wrapper svg { width: auto; height: auto; max-height: 110px; }

/* Elements Section */
.elements-container { margin-top: auto; padding-top: 20px; width: 100%; display: flex; flex-direction: column; align-items: flex-end; }
.element-row { display: flex; gap: 15px; font-size: 12px; margin-bottom: 5px; color: #000; }
.element-item { display: flex; align-items: center; gap: 8px; }
.el-fire, .el-earth, .el-air, .el-water { color: #000; }
.el-icon { width: 14px; height: 14px; stroke-width: 2; stroke: currentColor; fill: none; }

/* Quadrants Section */
.quadrants-container { margin-top: 10px; width: 100%; display: flex; flex-direction: column; align-items: flex-end; border-top: 1px solid #eee; padding-top: 10px; }
.quad-row { display: flex; gap: 15px; font-size: 11px; color: #555; margin-bottom: 3px; }

canvas { background-color: white; }

/* Modal Styles - Classic */
.modal {
    position: absolute;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #005a9e;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.3);
    width: 500px;
    display: none;
    overflow: visible;
    font-family: 'Segoe UI', sans-serif;
    border-radius: 0; /* Sharp corners */
}

.modal-header {
    padding: 6px 10px;
    cursor: move;
    background: #005a9e; /* Solid color */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    user-select: none;
    border-radius: 0;
}

.modal-header span:last-child {
    font-size: 16px;
    line-height: 1;
    opacity: 0.8;
    cursor: pointer;
}

.modal-header span:last-child:hover {
    opacity: 1;
    color: #ffcccc;
}

.modal-body {
    padding: 15px;
    background-color: #fcfcfc;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 0;
}

/* Specific override for Data Modal to allow dropdown overflow */
#dataModal .modal-body {
    overflow: visible;
    max-height: none;
}

.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 11px; margin-bottom: 4px; color: #333; font-weight: normal; }
.form-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    border: 1px solid #999;
    border-radius: 2px;
    font-size: 12px;
    background-color: #fff;
}

.form-group input:focus {
    border-color: #005a9e;
    outline: 1px solid #005a9e;
    box-shadow: none;
}

.form-row { display: flex; gap: 10px; margin-bottom: 10px; }
.form-row .form-group { flex: 1; margin-bottom: 0; }

.input-with-icon { display: flex; gap: 5px; align-items: center; }
.db-icon {
    cursor: pointer;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border: 1px solid #999;
    border-radius: 2px;
    font-size: 14px;
}
.db-icon:hover { background: #e0e0e0; }

/* Bases Dropdown */
.bases-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #999;
    border-radius: 0;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    display: none;
    min-width: 150px;
    z-index: 2000;
    padding: 2px 0;
}
.bases-item { padding: 4px 10px; cursor: pointer; font-size: 12px; color: #000; }
.bases-item:hover { background: #005a9e; color: white; }

/* View Settings Modal */
.settings-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; color: #000; }
.settings-item input[type="color"] {
    width: 24px;
    height: 24px;
    border: 1px solid #999;
    padding: 1px;
    cursor: pointer;
    border-radius: 0;
}
.settings-item input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
}
.settings-btn {
    padding: 2px 8px;
    background: #f0f0f0;
    border: 1px solid #999;
    border-radius: 2px;
    cursor: pointer;
    font-size: 11px;
    color: #000;
}
.settings-btn:hover { background: #e0e0e0; }

/* Dynamics Modal */
.dynamics-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; }
.dynamics-label { width: 60px; font-weight: bold; color: #000; }
.dynamics-controls { display: flex; gap: 4px; }
.dyn-btn {
    width: 30px;
    height: 22px;
    background: #f0f0f0;
    border: 1px solid #999;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
    font-size: 11px;
}
.dyn-btn:hover { background: #e0e0e0; }
.step-input { width: 50px !important; text-align: center; padding: 2px !important; }

/* Chart Type Dropdown */
.chart-type-wrapper { position: relative; }
.chart-type-btn {
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #999;
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 120px;
}
.chart-type-btn:hover { background: #f9f9f9; }

.chart-type-menu {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #999;
    border-radius: 0;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    display: none;
    z-index: 2000;
    overflow: hidden;
    margin-bottom: 0;
}
.chart-type-option {
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #000;
}
.chart-type-option:hover { background: #005a9e; color: white; }
.chart-type-option.selected { background: #e0e0e0; color: #000; font-weight: bold; }

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    border-top: 1px solid #ccc;
    padding-top: 10px;
}
.build-btn {
    padding: 4px 15px;
    background: #f0f0f0;
    color: #000;
    border: 1px solid #999;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}
.build-btn:hover { background: #e0e0e0; }
.build-btn:active { transform: translateY(1px); box-shadow: none; }

/* Tabs Styles */
.settings-tabs {
    display: flex;
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px;
    gap: 0;
}
.tab-btn {
    padding: 5px 12px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    border-radius: 3px 3px 0 0;
    font-size: 12px;
    color: #000;
    font-weight: normal;
    margin-right: 2px;
}
.tab-btn:hover {
    background: #f0f0f0;
}
.tab-btn.active {
    background: #fff;
    color: #000;
    border: 1px solid #ccc;
    border-bottom: 1px solid #fff;
    font-weight: bold;
    margin-bottom: -1px;
}
.tab-content {
    display: none;
    max-height: 400px;
    overflow-y: auto;
    padding-top: 10px;
}
.tab-content.active {
    display: block;
    animation: none;
}
.ruler-row, .aspect-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
    color: #000;
}
.aspect-row input[type="number"] {
    width: 50px;
    padding: 2px;
    border: 1px solid #999;
    border-radius: 2px;
    text-align: center;
}
.ruler-select {
    width: 110px;
    padding: 2px;
    border: 1px solid #999;
    border-radius: 2px;
}
.section-title {
    font-weight: bold;
    margin: 10px 0 5px 0;
    border-bottom: 1px solid #ccc;
    padding-bottom: 2px;
    color: #000;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
}
