/* Rules Page Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    overflow: hidden;
}

#cesiumContainer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

/* Header */
#rules-header {
    position: absolute;
    top: 10px;
    left: 320px;
    right: 340px;
    height: 40px;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title h1 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #333;
    color: #aaa;
    text-decoration: none;
    transition: all 0.15s;
}

.home-link:hover {
    background: #444;
    color: #fff;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Panels */
#left-panel {
    position: absolute;
    top: 60px;
    left: 10px;
    width: 300px;
    bottom: 10px;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid #333;
    border-radius: 8px;
    overflow-y: auto;
    z-index: 100;
}

#right-panel {
    position: absolute;
    top: 60px;
    right: 10px;
    width: 320px;
    bottom: 220px; /* Leave room for Cesium toolbar */
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid #333;
    border-radius: 8px;
    overflow-y: auto;
    z-index: 100;
    padding: 16px;
}

/* Panel Sections */
.panel-section {
    padding: 16px;
    border-bottom: 1px solid #333;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.section-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.section-desc {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
    line-height: 1.4;
}

.info-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #444;
    color: #aaa;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

/* Inclusion Zone Options */
.inclusion-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #2a2a4a;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.radio-option:hover:not(.disabled) {
    background: #333355;
}

.radio-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.radio-label {
    font-size: 13px;
}

.inclusion-actions {
    display: flex;
    gap: 8px;
}

/* Zones List */
.zones-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zone-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #2a2a4a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
}

.zone-item:hover {
    background: #333355;
}

.zone-item.selected {
    border-color: #2a7fff;
    background: #2a3a5a;
}

.zone-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.zone-info {
    flex: 1;
    min-width: 0;
}

.zone-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zone-rules-summary {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.zone-visibility-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #444;
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zone-visibility-btn:hover {
    background: #555;
    color: #fff;
}

.zone-visibility-btn.hidden-zone {
    color: #666;
}

.zone-duplicate-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #444;
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zone-duplicate-btn:hover {
    background: #555;
    color: #fff;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 13px;
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #aaa;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: #2a2a4a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2a7fff;
}

.field-hint {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #2a2a4a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.checkbox-option:hover {
    background: #333355;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.checkbox-grid .checkbox-option {
    padding: 6px 10px;
    font-size: 12px;
}

/* Style Options */
.style-options {
    display: flex;
    gap: 16px;
}

.color-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-field label {
    margin: 0;
    text-transform: none;
    font-weight: normal;
}

.color-field input[type="color"] {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

/* Form Actions */
.form-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #333;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-primary {
    background: #2a7fff;
    color: white;
}

.btn-primary:hover {
    background: #1a6fef;
}

.btn-secondary {
    background: #444;
    color: #ddd;
}

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

.btn-secondary.active {
    background: #2a7fff;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Import/Export */
.import-export-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Drawing Instructions */
.instructions-card {
    background: #2a3a5a;
    border: 1px solid #2a7fff;
    border-radius: 8px;
    padding: 16px;
}

.instructions-card h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #2a7fff;
}

.instructions-card p {
    font-size: 13px;
    color: #ccc;
    margin-bottom: 12px;
}

.instructions-card ul {
    font-size: 12px;
    color: #aaa;
    margin-left: 16px;
    margin-bottom: 16px;
}

.instructions-card li {
    margin-bottom: 4px;
}

/* Mode Indicator */
#mode-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(42, 127, 255, 0.95);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#mode-indicator.hidden {
    display: none;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: opacity 0.3s, transform 0.3s;
}

.notification.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.notification.success {
    background: #28a745;
    color: white;
}

.notification.error {
    background: #dc3545;
    color: white;
}

.notification.warning {
    background: #ffc107;
    color: #333;
}

.notification.info {
    background: #17a2b8;
    color: white;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Scrollbar styling */
#left-panel::-webkit-scrollbar,
#right-panel::-webkit-scrollbar {
    width: 8px;
}

#left-panel::-webkit-scrollbar-track,
#right-panel::-webkit-scrollbar-track {
    background: #1a1a2e;
}

#left-panel::-webkit-scrollbar-thumb,
#right-panel::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

#left-panel::-webkit-scrollbar-thumb:hover,
#right-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Tab Navigation */
.zone-tabs {
    display: flex;
    border-bottom: 1px solid #333;
}

.zone-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
}

.zone-tab:hover {
    color: #aaa;
    background: rgba(42, 127, 255, 0.05);
}

.zone-tab.active {
    color: #2a7fff;
    border-bottom-color: #2a7fff;
    background: rgba(42, 127, 255, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Tags Container */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: #2a2a4a;
    border: 1px solid #444;
    border-radius: 6px;
    min-height: 42px;
    margin-bottom: 8px;
}

.tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #2a7fff;
    color: white;
    border-radius: 4px;
    font-size: 12px;
}

.tag-remove {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.tag-remove:hover {
    opacity: 1;
    color: #ff4444;
}

.tag-input-row {
    display: flex;
    gap: 8px;
}

.tag-input-row input {
    flex: 1;
    padding: 8px 12px;
    background: #2a2a4a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
}

.tag-input-row input:focus {
    outline: none;
    border-color: #2a7fff;
}

/* Message Input Row */
.message-input-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-input-row select {
    width: 100%;
    padding: 8px 12px;
    background: #2a2a4a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
}

.message-input-row select:focus {
    outline: none;
    border-color: #2a7fff;
}

.message-input-row input {
    width: 100%;
    padding: 8px 12px;
    background: #2a2a4a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
}

.message-input-row input:focus {
    outline: none;
    border-color: #2a7fff;
}

/* Small checkbox variant */
.checkbox-small {
    padding: 6px 10px;
    font-size: 12px;
    background: transparent;
}

.checkbox-small:hover {
    background: rgba(42, 127, 255, 0.1);
}
