/* 
  BrokerConnect Dashboard & App Styles
  Extends styles.css
*/

/* Reset body for dashboard layout */
.dashboard-body {
    background-color: var(--grey-bg);
    overflow-x: hidden;
}

/* Authentication Page Layout */
.auth-page {
    background-color: var(--black);
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .auth-page {
        background-image: linear-gradient(to right, var(--black) 50%, var(--grey-bg) 50%);
    }
    
    .auth-container {
        grid-template-columns: 1fr 1fr;
    }
}

.auth-branding {
    padding: 6vw;
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; /* Ensure no auto-center stretching happens */
    text-align: left;
}

.auth-branding .logo {
    filter: brightness(0) invert(1); /* Make logo white */
    margin: 0 0 4rem 0 !important; /* Ensure absolute left margins */
}

.auth-branding .lead-text {
    color: var(--grey-light);
}

.auth-form-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vw;
}

.auth-panel {
    width: 100%;
    max-width: 500px;
    background: var(--white);
    padding: 2rem;
    border-radius: 4px;
}

.auth-panel .form-header {
    text-align: left !important;
}

@media (min-width: 768px) {
    .auth-panel {
        padding: 3rem;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--grey-dark);
}

.auth-footer a {
    font-weight: 500;
    border-bottom: 1px solid var(--black);
}

/* App Core Layout */
.app-header {
    height: 70px;
    background: var(--white);
    border-bottom: 1px solid var(--grey-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-logo .logo {
    height: 32px;
}

.app-badge {
    background: var(--grey-bg);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--grey-light);
}

.admin-badge {
    background: var(--black);
    color: var(--white);
}

.app-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.user-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00d166;
}

.user-org {
    color: var(--grey-dark);
    padding-left: 1rem;
    border-left: 1px solid var(--grey-light);
}

.app-layout {
    display: flex;
    padding-top: 70px; /* Offset for header */
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--grey-light);
    position: fixed;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
}

.nav-item {
    padding: 1rem 2rem;
    color: var(--grey-dark);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-item:hover, .nav-item.active {
    background: var(--grey-bg);
    color: var(--black);
    border-left-color: var(--black);
}

.badge-count {
    background: var(--grey-light);
    color: var(--grey-dark);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    margin-left: auto;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.badge-count.active {
    display: inline-flex;
    background: #dc2626;
    color: var(--white);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Main Content Workspace */
.app-content {
    flex: 1;
    margin-left: 260px;
    padding: 3rem;
}

.tab-pane, .dashboard-tab {
    display: none;
}

.tab-pane.active, .dashboard-tab.active {
    display: block;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--grey-light);
}

.content-header h2 {
    font-size: 1.5rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--grey-light);
    background-color: var(--white);
    font-size: 0.875rem;
}

/* Auction Grid */
.auction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.auction-card {
    background: var(--white);
    border: 1px solid var(--grey-light);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
}

.auction-card:hover {
    border-color: var(--black);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--grey-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: var(--grey-bg);
    border: 1px solid var(--grey-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    font-size: 0.6875rem;
    border-radius: 2px;
}

.tag-new { background: #e0f2fe; border-color: #bae6fd; color: #0284c7; }
.tag-hot { background: #fee2e2; border-color: #fecaca; color: #dc2626; }
.tag-pending { background: #fef3c7; border-color: #fde68a; color: #d97706; }

.text-danger { color: #dc2626; }

.card-body {
    padding: 1.5rem;
}

.lead-industry {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.lead-specs {
    display: flex;
    border-top: 1px solid var(--grey-light);
    padding-top: 1rem;
}

.spec {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--grey-light);
    padding: 0 1rem;
}

.spec:first-child { padding-left: 0; }
.spec.border-none { border-right: none; padding-right: 0; }

.spec span {
    font-size: 0.75rem;
    color: var(--grey-mid);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
}

.spec strong {
    font-size: 0.875rem;
}

.card-bidding {
    padding: 1.5rem;
    background: var(--grey-bg);
    border-top: 1px solid var(--grey-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.bid-status span {
    display: block;
    font-size: 0.75rem;
    color: var(--grey-mid);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.current-price {
    font-size: 1.5rem;
    font-weight: 600;
}

.bid-leader {
    font-size: 0.75rem;
    color: #00d166 !important;
    font-weight: 500;
}

.bid-action {
    display: flex;
    gap: 0.5rem;
}

.bid-input {
    width: 90px;
    padding: 0.5rem;
    border: 1px solid var(--grey-light);
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
}

.bid-input:disabled {
    background: transparent;
    color: var(--grey-mid);
    border-color: transparent;
}

/* Admin Tables */
.section-heading-sm {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--black);
}

.data-table-wrapper {
    background: var(--white);
    border: 1px solid var(--grey-light);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--grey-light);
}

.data-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grey-mid);
    background: var(--grey-bg);
    font-weight: 500;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #fafafa;
}

.td-sub {
    font-size: 0.8125rem;
    color: var(--grey-mid);
}

.price-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--grey-light);
    width: 120px;
}

.price-input-group .currency {
    padding: 0.5rem;
    background: var(--grey-bg);
    border-right: 1px solid var(--grey-light);
    color: var(--grey-dark);
}

.admin-input-sm {
    width: 100%;
    padding: 0.5rem;
    border: none;
    font-family: inherit;
    font-size: 0.875rem;
}

.admin-input-sm:focus {
    outline: none;
}

/* Auction Highlights */
.leading-row {
    background-color: #f0fdf4 !important; /* light emerald */
}
.leading-row td {
    border-bottom-color: #dcfce7 !important;
}

/* Premium Sidebar User Card */
.sidebar-user-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1.5rem;
    border-top: 1px solid var(--grey-light);
    background: var(--white);
}

.indicator-dot {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--grey-light);
    color: var(--white);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.indicator-dot.active {
    display: inline-flex;
    background: #dc2626;
    animation: pulse-red 2s infinite;
}

.user-info-sm {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    background: var(--grey-bg);
    border-radius: 50%;
    border: 1px solid var(--grey-mid);
}

.user-details-sm {
    display: flex;
    flex-direction: column;
}

.user-name-display {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--black);
}

.logout-link-sm {
    font-size: 0.75rem;
    color: #0458AD;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.logout-link-sm:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Tabs System */
.tab-link {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grey-mid);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.tab-link:hover, .tab-link.active {
    color: var(--black);
    border-bottom-color: var(--black);
}

.tab-pane, .dashboard-tab {
    display: none;
}

.tab-pane.active, .dashboard-tab.active {
    display: block;
}

.indicator-dot {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--grey-light);
    color: var(--white);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.indicator-dot.active {
    display: inline-flex;
    background: #dc2626;
    animation: pulse-red 2s infinite;
}

.timer-display {
    font-family: 'JetBrains Mono', 'Courier New', monospace; /* Monospace for numbers */
    font-weight: 600;
    font-size: 0.9375rem;
}

.timer-warning {
    color: #dc2626;
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% { opacity: 0; }
}
