/* Sonic Alert HomeAware Portal Styles */

:root {
    --sa-dark-blue: #0b274e;
    --sa-light-blue: #0fa6e5;
    --sa-white: #ffffff;
    --sa-gray-light: #f8f9fa;
    --sa-gray: #6c757d;
}

html {
    font-size: 14px;
    height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

.content-area {
    flex: 1;
    overflow-y: auto;
}

/* Header top border - 18px dark blue */
.header-top-border {
    height: 18px;
    background-color: var(--sa-dark-blue);
}

/* Site header */
.site-header {
    background-color: var(--sa-white);
    border-bottom: 1px solid #ddd;
}

.site-logo {
    max-height: 60px;
    width: auto;
}

.return-link a {
    color: var(--sa-light-blue);
    text-decoration: underline;
    font-weight: 500;
}

.return-link a:hover {
    color: var(--sa-light-blue);
}

/* Main navigation */
.main-nav {
    background-color: var(--sa-dark-blue);
    padding: 0;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-menu .nav-item {
    position: relative;
}

.nav-menu .nav-item a {
    display: block;
    padding: 12px 20px;
    color: var(--sa-white);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.nav-menu .nav-item:hover,
.nav-menu .nav-item.active {
    background-color: var(--sa-light-blue);
}

.nav-menu .nav-item a:hover {
    color: var(--sa-white);
}

/* Dropdown menus */
.nav-menu .dropdown-menu {
    border-radius: 0;
    border: none;
    background-color: var(--sa-dark-blue);
    margin-top: 0;
    min-width: 200px;
}

.nav-menu .dropdown-item {
    color: var(--sa-white);
    padding: 10px 20px;
}

.nav-menu .dropdown-item:hover {
    background-color: var(--sa-light-blue);
    color: var(--sa-white);
}

/* Footer - 35px height, pinned to bottom */
.site-footer {
    flex-shrink: 0;
    height: 35px;
    line-height: 35px;
    background-color: var(--sa-gray-light);
    border-top: 1px solid #ddd;
    font-size: 12px;
    color: var(--sa-gray);
}

/* Loading overlay (replaces DevExpress ASPxLoadingPanel) */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--sa-gray-light);
    border-top: 5px solid var(--sa-light-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* HomeAware logo styling */
.homeaware-logo {
    max-width: 280px;
    margin-bottom: 15px;
}

/* Subscription title */
.subscription-title {
    color: var(--sa-dark-blue);
    font-weight: 600;
    margin-bottom: 30px;
}

/* Device grid table */
.device-grid {
    width: 100%;
    margin-top: 20px;
}

.device-grid th {
    background-color: var(--sa-dark-blue);
    color: var(--sa-white);
    padding: 12px;
    font-weight: 500;
}

.device-grid td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.device-grid tr:hover {
    background-color: var(--sa-gray-light);
}

/* Connection status badges */
.status-connected {
    color: #28a745;
    font-weight: 500;
}

.status-disconnected {
    color: #dc3545;
    font-weight: 500;
}

/* Subscription status */
.subscription-active {
    color: #28a745;
    font-weight: 500;
}

.subscription-none {
    color: var(--sa-gray);
}

/* Buttons - square corners site-wide */
.btn {
    border-radius: 0;
}

.btn-sonic {
    background-color: var(--sa-light-blue);
    border-color: var(--sa-light-blue);
    color: var(--sa-white);
}

.btn-sonic:hover {
    background-color: var(--sa-dark-blue);
    border-color: var(--sa-dark-blue);
    color: var(--sa-white);
}

.btn-sonic-outline {
    background-color: transparent;
    border: 2px solid var(--sa-light-blue);
    color: var(--sa-light-blue);
}

.btn-sonic-outline:hover {
    background-color: var(--sa-light-blue);
    color: var(--sa-white);
}

.btn-stax {
    background-color: #223f99;
    border-color: #223f99;
    color: #ffffff;
    font-weight: bold;
}

.btn-stax:hover {
    background-color: #1a3278;
    border-color: #1a3278;
    color: #ffffff;
}

.btn-stax:disabled {
    background-color: #898989;
    border-color: #898989;
    color: #ffffff;
}

/* Status message page */
.status-page {
    text-align: center;
    padding: 50px 20px;
}

.status-page .status-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.status-page .status-icon.error {
    color: #dc3545;
}

.status-page .status-icon.warning {
    color: #ffc107;
}

.status-page .status-icon.info {
    color: var(--sa-light-blue);
}

.status-page h1 {
    color: var(--sa-dark-blue);
    margin-bottom: 20px;
}

.status-page p {
    font-size: 18px;
    color: var(--sa-gray);
    max-width: 500px;
    margin: 0 auto 30px;
}

/* Focus states */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--sa-light-blue);
}

/* Registration section */
.registration-section {
    background-color: var(--sa-gray-light);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.registration-section h3 {
    color: var(--sa-dark-blue);
    margin-bottom: 15px;
}

.registration-section p {
    max-width: 300px;
    margin-bottom: 15px;
}

.registration-section ul {
    max-width: 280px;
    padding-left: 20px;
    margin-bottom: 20px;
}

.registration-section ul li {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Administration page styles */
.admin-tabs {
    margin-bottom: 0;
    border-bottom: 2px solid var(--sa-dark-blue);
}

.admin-tabs .nav-link {
    color: var(--sa-dark-blue);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-weight: 500;
}

.admin-tabs .nav-link:hover {
    color: var(--sa-light-blue);
    border-bottom-color: var(--sa-light-blue);
}

.admin-tabs .nav-link.active {
    color: var(--sa-light-blue);
    background-color: transparent;
    border-bottom: 3px solid var(--sa-light-blue);
}

.admin-tab-content {
    background-color: var(--sa-white);
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    min-height: 400px;
}

.admin-grid {
    font-size: 13px;
}

.admin-grid th {
    background-color: var(--sa-dark-blue);
    color: var(--sa-white);
    padding: 10px 8px;
    font-weight: 500;
    white-space: nowrap;
}

.admin-grid td {
    padding: 8px;
    vertical-align: middle;
}

.admin-grid tr:hover {
    background-color: rgba(15, 166, 229, 0.1);
}

.admin-grid .btn-sm {
    padding: 2px 8px;
    font-size: 12px;
}

/* Pagination for admin pages */
.admin-tab-content .pagination {
    margin-top: 20px;
    margin-bottom: 0;
}

.admin-tab-content .page-link {
    color: var(--sa-dark-blue);
}

.admin-tab-content .page-item.active .page-link {
    background-color: var(--sa-light-blue);
    border-color: var(--sa-light-blue);
}

/* Personal Information page styles */
.invite-box, .join-box {
    background-color: var(--sa-dark-blue);
    color: white;
    padding: 20px;
    border-radius: 4px;
    width: 280px;
}

.invite-box h4, .join-box h4 {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 0;
}

.invite-box .form-label, .join-box .form-label {
    color: white;
    font-weight: 500;
    font-size: 13px;
}

.btn-invite {
    background-color: #223f99;
    border-color: #223f99;
    color: white;
    font-weight: bold;
}

.btn-invite:hover {
    background-color: #1a3278;
    border-color: #1a3278;
    color: white;
}

.btn-invite:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
}

.section-header {
    color: var(--sa-dark-blue);
    font-size: 24px;
    margin-bottom: 15px;
    margin-top: 30px;
}

.contact-grid {
    font-size: 14px;
}

.contact-grid th {
    background-color: var(--sa-dark-blue);
    color: white;
    padding: 10px 12px;
    font-weight: 500;
}

.contact-grid td {
    padding: 10px 12px;
    vertical-align: middle;
}

.info-icon {
    cursor: help;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: var(--sa-dark-blue);
    border-radius: 50%;
}

.info-icon img {
    width: 12px;
    height: 12px;
    filter: brightness(0) invert(1);
}
