/* Custom styles for Shoremem Premium Organization Management */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    margin: 0;
    padding: 0;
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    background: linear-gradient(180deg, #052767 0%, #3a0647 70%);
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar .navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: white !important;
}

.sidebar .nav-link {
    color: #d7d7d7 !important;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
    font-weight: 600;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

/* Main Content Styles */
.content {
    background-color: #f8f9fa;
    min-height: calc(100vh - 3.5rem);
}

.top-row {
    background: white;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Button Styles */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(45deg, #0d6efd, #0056b3);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
}

/* Organization Chart Styles */
.organization-chart-container {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.persona-node {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.persona-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.persona-node.executive {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff, #ffe6e6);
}

.persona-node.senior-manager {
    border-color: #fd7e14;
    background: linear-gradient(135deg, #fff, #fff3e0);
}

.persona-node.manager {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff, #fffbf0);
}

.persona-node.team-lead {
    border-color: #20c997;
    background: linear-gradient(135deg, #fff, #e6fff9);
}

.persona-node.senior {
    border-color: #6f42c1;
    background: linear-gradient(135deg, #fff, #f3e6ff);
}

.persona-node.standard {
    border-color: #6c757d;
    background: linear-gradient(135deg, #fff, #f8f9fa);
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.175);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.modal-title {
    font-weight: 600;
    color: var(--dark-color);
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Badge Styles */
.badge {
    font-weight: 500;
    border-radius: 0.375rem;
}

/* Progress Bar Styles */
.progress {
    border-radius: 0.5rem;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 0.5rem;
    transition: width 0.6s ease;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Design */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0 !important;
    }
    
    .top-row {
        margin-left: 0 !important;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm-hover:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow-hover:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}



/* NavMenu Styles */
.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
}

.top-row {
    height: 3.5rem;
    background-color: rgba(0,0,0,0.4);
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 600;
}

.oi {
    width: 2rem;
    font-size: 1.1rem;
    vertical-align: text-top;
    top: -2px;
}

.nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

.nav-item:first-of-type {
    padding-top: 1rem;
}

.nav-item:last-of-type {
    padding-bottom: 1rem;
}

.nav-item ::deep a {
    color: #d7d7d7;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
    transition: all 0.3s ease;
}

.nav-item ::deep a.active {
    background-color: rgba(255,255,255,0.37);
    color: white;
}

.nav-item ::deep a:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.nav-scrollable {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow-y: auto;
    height: calc(100vh - 3.5rem);
    padding-bottom: 60px;
}

.navbar-toggler:checked {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Chat Styles */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #6c757d;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { 
    animation-delay: -0.32s; 
}

.typing-indicator span:nth-child(2) { 
    animation-delay: -0.16s; 
}

@keyframes typing {
    0%, 80%, 100% { 
        transform: scale(0); 
    }
    40% { 
        transform: scale(1); 
    }
}

/* Layout fixes */
.page {
    position: relative;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

main {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Removed problematic top-row styling that caused header overlap */

.content {
    flex: 1;
    padding: 1rem;
    background-color: #f8f9fa;
}

/* Always show navigation on desktop */
@media (min-width: 768px) {
    .navbar-toggler {
        display: none;
    }

    .nav-scrollable {
        display: flex !important;
    }
}

/* Mobile responsive */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    main {
        margin-left: 0;
    }
    
    .navbar-toggler {
        display: block;
    }
}


/* Navigation Logo Styles */
.nav-logo {
    height: 32px;
    width: auto;
    max-width: 150px;
}

.navbar-brand {
    padding: 0.5rem 0;
}


/* Tab Navigation Alignment Fix */
.nav-tabs {
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: flex-end; /* Align all tabs to the bottom */
}

.nav-tabs .nav-item {
    margin-bottom: 0; /* Remove any bottom margin */
    padding-bottom: 0; /* Remove any bottom padding */
}

.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
    padding: 0.75rem 1rem; /* Consistent padding for all tabs */
    margin-bottom: 0; /* Ensure no bottom margin */
    display: flex;
    align-items: center;
    height: auto; /* Let height be determined by content and padding */
    line-height: 1.5; /* Consistent line height */
}

.nav-tabs .nav-link.active {
    color: #495057;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    border-bottom: 1px solid #fff; /* Hide bottom border for active tab */
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    isolation: isolate;
}

/* Ensure consistent vertical alignment for tab content */
.nav-tabs .nav-link i {
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Fix for Bootstrap tab content */
.tab-content {
    border: 1px solid #dee2e6;
    border-top: none;
    padding: 1rem;
    background-color: #fff;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Ensure all tab buttons have the same baseline */
.nav-tabs .nav-item .nav-link {
    vertical-align: baseline;
    display: inline-flex;
    align-items: center;
}

/* Fix for any custom tab styling that might cause misalignment */
.nav-tabs .nav-item:first-child .nav-link {
    margin-left: 0;
}

/* Ensure consistent spacing between tabs */
.nav-tabs .nav-item + .nav-item {
    margin-left: 0.25rem;
}


/* Navigation Section Headers */
.nav-section-header {
    color: #ffffff !important;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0.5rem 0.25rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.nav-section-header i {
    opacity: 0.8;
}

/* Nested navigation items */
.nav-item.ms-3 .nav-link {
    font-size: 0.9rem;
    padding-left: 2rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: 1rem;
}

.nav-item.ms-3 .nav-link:hover {
    border-left-color: rgba(255, 255, 255, 0.4);
}

.nav-item.ms-3 .nav-link.active {
    border-left-color: var(--primary-color);
}


/* Collapsible Memory Management Navigation */
.collapsible-header {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.collapsible-header:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
}

.memory-management-submenu {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.memory-management-submenu.collapsed {
    max-height: 0;
    opacity: 0;
}

.memory-management-submenu.expanded {
    max-height: fit-content;
    opacity: 1;
    overflow: visible;
}

.collapsible-header i.ms-auto {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.collapsible-header:hover i.ms-auto {
    transform: scale(1.1);
}

.security-center-submenu {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.security-center-submenu.collapsed {
    max-height: 0;
    opacity: 0;
}

.security-center-submenu.expanded {
    max-height: fit-content;
    opacity: 1;
    overflow: visible;
}

.sql-query-manager-submenu {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.sql-query-manager-submenu.collapsed {
    max-height: 0;
    opacity: 0;
}

.sql-query-manager-submenu.expanded {
    max-height: fit-content;
    opacity: 1;
    overflow: visible;
}

.email-management-submenu {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.email-management-submenu.collapsed {
    max-height: 0;
    opacity: 0;
}

.email-management-submenu.expanded {
    max-height: 500px;
    opacity: 1;
}

.testing-submenu {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.testing-submenu.collapsed {
    max-height: 0;
    opacity: 0;
}

.testing-submenu.expanded {
    max-height: 500px;
    opacity: 1;
}

/* InfoTip popup — appended to document.body via JS, position:fixed */
.infotip-bubble {
    position: fixed;
    transform: translate(-50%, -100%) translateY(-8px);
    background: #1a1a2e;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
    white-space: normal;
    width: max-content;
    max-width: 300px;
    padding: 10px 14px;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    z-index: 9999;
    text-align: left;
    animation: infotip-in 0.15s ease-out;
}
.infotip-bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a1a2e;
}
@keyframes infotip-in {
    from { opacity: 0; transform: translate(-50%, -100%) translateY(-2px); }
    to   { opacity: 1; transform: translate(-50%, -100%) translateY(-8px); }
}
.infotip-bubble--below {
    transform: translate(-50%, 8px);
    animation: infotip-in-below 0.15s ease-out;
}
.infotip-bubble--below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #1a1a2e;
}
@keyframes infotip-in-below {
    from { opacity: 0; transform: translate(-50%, 2px); }
    to   { opacity: 1; transform: translate(-50%, 8px); }
}

/* InfoTip rich variant — wider popup with code/list formatting */
.infotip-rich {
    max-width: 380px;
    font-size: 0.78rem;
    line-height: 1.55;
}
.infotip-rich p {
    margin: 0 0 0.45em;
}
.infotip-rich p:last-child {
    margin-bottom: 0;
}
.infotip-rich ul {
    margin: 0.3em 0 0.45em 1.1em;
    padding: 0;
}
.infotip-rich li {
    margin-bottom: 0.2em;
}
.infotip-rich code {
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
    padding: 0 3px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.9em;
    color: #f0c674 !important; /* amber — override Bootstrap code colour */
}
.infotip-rich strong {
    color: #e2e8f0;
}
.infotip-rich hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin: 0.5em 0;
}
.infotip-rich ol {
    margin: 0.3em 0 0.45em 1.2em;
    padding: 0;
}
.infotip-rich em {
    color: #cbd5e1;
    font-style: italic;
}

/* ===== Form control visibility fixes ===== */

/* Radio buttons — ensure they render at a legible size with a clear border */
.form-check-input[type="radio"] {
    width: 1.1em;
    height: 1.1em;
    border: 2px solid #6c757d;
    background-color: #fff;
    appearance: auto;
    -webkit-appearance: auto;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 0.2em;
}

.form-check-input[type="radio"]:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Range slider — make the track and thumb clearly visible */
.form-range {
    cursor: pointer;
    height: 1.5rem;
    padding: 0;
}

.form-range::-webkit-slider-runnable-track {
    height: 6px;
    background: #dee2e6;
    border-radius: 3px;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    margin-top: -8px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #0d6efd;
}

.form-range::-moz-range-track {
    height: 6px;
    background: #dee2e6;
    border-radius: 3px;
    border: none;
}

.form-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #0d6efd;
}

/* =============================================
   Markdown Content Styles (.markdown-content)
   Used by MarkdownMessage component and
   SKILL.md rendering on SkillDetail page.
   ============================================= */

.markdown-content {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #212529;
    word-break: break-word;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a2e;
}

.markdown-content h1 { font-size: 1.5rem; border-bottom: 2px solid #dee2e6; padding-bottom: 0.3rem; }
.markdown-content h2 { font-size: 1.25rem; border-bottom: 1px solid #dee2e6; padding-bottom: 0.25rem; }
.markdown-content h3 { font-size: 1.1rem; }
.markdown-content h4 { font-size: 1rem; }

.markdown-content p {
    margin-bottom: 0.75rem;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin-bottom: 0.25rem;
}

.markdown-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
    background-color: #f0f2f5;
    color: #c7254e;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    border: 1px solid #e0e3e8;
}

.markdown-content pre {
    background-color: #1e1e2e;
    color: #cdd6f4;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    line-height: 1.5;
    border: 1px solid #313244;
}

.markdown-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
    border-radius: 0;
}

.markdown-content blockquote {
    border-left: 4px solid #0d6efd;
    background-color: #f0f6ff;
    padding: 0.5rem 1rem;
    margin: 0.75rem 0;
    border-radius: 0 4px 4px 0;
    color: #495057;
}

.markdown-content blockquote p:last-child {
    margin-bottom: 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid #dee2e6;
    padding: 0.4rem 0.75rem;
    text-align: left;
}

.markdown-content table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.markdown-content table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 1.25rem 0;
}

.markdown-content a {
    color: #0d6efd;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

/* Task list checkboxes */
.markdown-content input[type="checkbox"] {
    margin-right: 0.4em;
}
