/* Common Styles for Axis Gyro Bluetooth Service */

/* Toast Notifications */
.toast-notification {
    background: white;
    border: 1px solid #edebe9;
    border-radius: 4px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 250px;
    max-width: 400px;
    font-size: 14px;
    color: #323130;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
}

.toast-notification.toast-success {
    border-left: 4px solid #107c10;
}

.toast-notification.toast-error {
    border-left: 4px solid #a4262c;
}

.toast-notification.toast-info {
    border-left: 4px solid #0078d4;
}

:root { 
    color-scheme: light; 
}

* { 
    box-sizing: border-box; 
}

body { 
    font-family: "Segoe UI", Arial, sans-serif; 
    margin: 0; 
    padding: 0; 
    background: #f3f2f1; 
    color: #323130; 
    min-height: 100vh;
}

/* Header Bar */
.header-bar {
    background: #1a1a1a;
    color: white;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo {
    height: 32px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.header-icon-button:hover {
    background: rgba(255,255,255,0.2);
}

/* Main Layout */
.main-layout {
    display: flex;
    position: relative;
    min-height: calc(100vh - 56px);
}

/* Sidebar */
.sidebar {
    width: 0;
    background: #f3f2f1;
    border-right: 1px solid #edebe9;
    padding: 16px 0;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 56px;
    height: calc(100vh - 56px);
    z-index: 90;
    transition: width 0.3s ease-in-out;
    overflow-x: hidden;
}

.sidebar.active {
    width: 240px;
}

.sidebar-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 85;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

.sidebar-link {
    display: block;
    padding: 12px 24px;
    color: #323130;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.sidebar-link:hover {
    background: #e1dfdd;
}

.sidebar-link.active {
    background: #0078D4;
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f3f2f1;
    width: 100%;
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

/* When sidebar is active on desktop, shift content */
@media (min-width: 768px) {
    .sidebar.active ~ .main-content {
        margin-left: 240px;
    }
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #323130;
    margin: 0 0 24px 0;
}

/* Common Button Styles */
.tool-button {
    padding: 8px 16px;
    border: 1px solid #edebe9;
    border-radius: 4px;
    background: white;
    color: #323130;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-button:hover:not(:disabled) {
    background: #f3f2f1;
}

.tool-button.active {
    background: #0078D4;
    color: white;
    border-color: #0078D4;
}

.tool-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal dialog (used by React UI) */
.axis-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
}

.axis-modal {
    width: min(560px, 96vw);
    max-height: 90vh;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #edebe9;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.axis-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #edebe9;
    background: #faf9f8;
}

.axis-modal-title {
    font-weight: 700;
    color: #323130;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.axis-modal-body {
    padding: 12px 14px;
    overflow: auto;
    /* Fill available space so the modal height stays stable. */
    flex: 1 1 auto;
}

.axis-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid #edebe9;
    background: #ffffff;
}

.axis-modal-label {
    display: block;
    font-size: 12px;
    color: #605e5c;
    font-weight: 600;
    margin-bottom: 6px;
}

.axis-modal-input {
    width: 100%;
    height: 34px;
    padding: 6px 10px;
    border: 1px solid #edebe9;
    border-radius: 6px;
    background: #ffffff;
    color: #201f1e;
    font-size: 14px;
}

.axis-modal-input:disabled {
    background: #faf9f8;
}

.axis-modal-error {
    margin-top: 8px;
    font-size: 12px;
    color: #a4262c;
    font-weight: 600;
}

/* Modal/Dialog Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-dialog {
    background: white;
    padding: 24px;
    border-radius: 8px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 6px 10px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-weight: 600;
    font-size: 18px;
    color: #323130;
}

.modal-content {
    padding: 12px;
    background: #faf9f8;
    border: 1px solid #edebe9;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    overflow: auto;
    flex: 1;
}

/* Empty State */
.empty-state {
    padding: 48px;
    text-align: center;
    color: #605e5c;
}

/* Form Elements */
.service-dropdown {
    flex: 1;
    max-width: 400px;
    padding: 12px 16px;
    border: 1px solid #edebe9;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.refresh-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #edebe9;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.refresh-button:hover {
    background: #f3f2f1;
}

/* Fluent UI overrides */
fluent-button { 
    margin-right: 8px; 
}

fluent-select { 
    position: relative; 
    z-index: 2000; 
}

fluent-select::part(listbox) { 
    z-index: 5000; 
    position: fixed; 
}
