﻿/* =============================================================================
   DEXASIGN CONSOLE v2.0
   Console-Specific Styles (extends dashboard.css)
   ============================================================================= */

/* =============================================================================
   APPLICATION CARDS
   ============================================================================= */

.app-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    cursor: pointer;
    transition: all var(--transition-base);
}

.app-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.app-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.app-card-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.app-card-id {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.app-card-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-card-stats {
    display: flex;
    gap: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.app-stat {
    flex: 1;
}

.app-stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.app-stat-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

.app-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-3);
    margin-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.app-card-date {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* =============================================================================
   GETTING STARTED STEPS
   ============================================================================= */

.steps-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.step {
    display: flex;
    gap: var(--space-4);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-inverse);
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    padding-top: var(--space-2);
}

.step-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.step-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin: 0;
}

/* =============================================================================
   APPLICATION DETAILS PAGE
   ============================================================================= */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-3);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.detail-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.detail-value {
    font-size: var(--text-sm);
    color: var(--text-primary);
    word-break: break-all;
}

.detail-value code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    background: var(--bg-tertiary);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

/* =============================================================================
   DOCUMENTATION PAGE (if needed)
   ============================================================================= */

.docs-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-8);
}

.docs-sidebar {
    position: sticky;
    top: calc(64px + var(--space-8));
    height: fit-content;
}

.docs-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-nav-item {
    margin-bottom: var(--space-1);
}

.docs-nav-link {
    display: block;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.docs-nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.docs-nav-link.active {
    color: var(--primary);
    background: var(--primary-50);
    font-weight: 500;
}

.docs-content {
    min-width: 0;
}

/* =============================================================================
   CONSOLE SPECIFIC EMPTY STATES
   ============================================================================= */

.empty-apps {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-12);
    text-align: center;
    background: var(--bg-primary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

.empty-apps > svg {
    width: 80px;
    height: 80px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-4);
}

.empty-apps h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-apps p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    max-width: 300px;
}

/* =============================================================================
   HEADER WITH ACTION (Applications page)
   ============================================================================= */

.header-with-action {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
}

.header-content {
    flex: 1;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .docs-container {
        grid-template-columns: 1fr;
    }
    
    .docs-sidebar {
        position: static;
    }
    
    .app-card-stats {
        flex-direction: column;
        gap: var(--space-3);
    }
}

/* =============================================================================
   DROPDOWNS
   ============================================================================= */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 50;
    min-width: 180px;
    margin-top: var(--space-1);
    padding: var(--space-2);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
}

.dropdown-menu.active,
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-primary);
    text-align: left;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dropdown-item-danger {
    color: var(--danger);
}

.dropdown-item-danger:hover {
    background: var(--danger-light);
}

/* =============================================================================
   ICON BUTTONS
   ============================================================================= */

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.btn-icon-only {
    width: 40px;
    padding: 0;
}

#settingsBtn {
    width: 30px;
    height: 30px;
    background: var(--bg-primary);
    border: 1px solid #E5E7EB;
    color: var(--text-primary);
}

#settingsBtn:hover {
    background: var(--bg-tertiary);
    border: 1px solid #D1D5DB;
    color: var(--text-secondary);
}

#settingsBtn svg {
    width: 14px;
    height: 14px;
}

/* =============================================================================
   BREADCRUMBS
   ============================================================================= */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--text-tertiary);
}

/* =============================================================================
   CODE BLOCKS
   ============================================================================= */

.code-block-container {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.code-block {
    margin: 0;
    padding: var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    line-height: var(--leading-relaxed);
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: auto;
}

/* =============================================================================
   INFO BANNERS
   ============================================================================= */

.info-banner {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.info-banner p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.info-banner a {
    color: var(--primary);
    text-decoration: none;
}

.info-banner a:hover {
    text-decoration: underline;
}

/* =============================================================================
   CHARTS
   ============================================================================= */

.chart-container {
    position: relative;
    height: 300px;
}

/* =============================================================================
   AUTH HISTORY TABLE
   ============================================================================= */

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.history-table td {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.history-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Status badges in tables */
.status-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 var(--space-2);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.status-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.status-failed {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.score-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 var(--space-2);
    font-size: var(--text-xs);
    font-weight: 500;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: var(--radius-sm);
}

.table-responsive {
    overflow-x: auto;
}

/* =============================================================================
   FORM SECTIONS
   ============================================================================= */

.form-section {
    margin-bottom: var(--space-5);
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}

/* =============================================================================
   TOGGLE SWITCH
   ============================================================================= */

.toggle-group {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: var(--transition-base);
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-base);
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background-color: var(--success);
}

/* =============================================================================
   INTEGRATION CODE WINDOW
   ============================================================================= */

.integration-code-window {
    background: #1E293B;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.integration-code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #334155;
    border-bottom: 1px solid #475569;
}

.integration-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.integration-dot.red    { background: #EF4444; }
.integration-dot.yellow { background: #F59E0B; }
.integration-dot.green  { background: #10B981; }

.integration-code-title {
    margin-left: 8px;
    font-size: 12px;
    color: #94A3B8;
    flex: 1;
}

.integration-copy-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #475569;
    border: none;
    border-radius: 6px;
    color: #CBD5E1;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.integration-copy-btn:hover { background: #64748B; }
.integration-copy-btn.copied { background: #166534; color: #86EFAC; }

/* Light mode variant */
.integration-code-window.light {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
}
.integration-code-window.light .integration-code-header {
    background: #F1F5F9;
    border-bottom: 1px solid #E2E8F0;
}
.integration-code-window.light .integration-code-title { color: #64748B; }
.integration-code-window.light .integration-copy-btn { background: #E2E8F0; color: #475569; }
.integration-code-window.light .integration-copy-btn:hover { background: #CBD5E1; }
.integration-code-window.light .integration-code-content { color: #1E293B; }
.integration-code-window.light .integration-code-content .icmt { color: #94A3B8; }
.integration-code-window.light .integration-code-content .itag  { color: #0369A1; }
.integration-code-window.light .integration-code-content .iattr { color: #7C3AED; }
.integration-code-window.light .integration-code-content .istr  { color: #16A34A; }
.integration-code-window.light .integration-code-content .ikw   { color: #9333EA; }
.integration-code-window.light .integration-code-content .ifn   { color: #B45309; }
.integration-code-window.light .integration-code-content .iprm  { color: #EA580C; }

/* Theme toggle pill */
.integration-theme-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
}
.integration-theme-toggle input { opacity: 0; width: 0; height: 0; }
.integration-theme-slider {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #CBD5E1;
    border-radius: 20px;
    transition: background 0.2s;
}
.integration-theme-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}
.integration-theme-toggle input:checked + .integration-theme-slider { background: var(--primary); }
.integration-theme-toggle input:checked + .integration-theme-slider::before { transform: translateX(16px); }

.integration-code-content {
    padding: 20px 24px;
    margin: 0;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    overflow-x: auto;
    color: #E2E8F0;
    white-space: pre;
}

.integration-code-content .icmt { color: #64748B; }
.integration-code-content .itag { color: #7DD3FC; }
.integration-code-content .iattr { color: #A5B4FC; }
.integration-code-content .istr { color: #86EFAC; }
.integration-code-content .ikw  { color: #C084FC; }
.integration-code-content .ifn  { color: #FCD34D; }
.integration-code-content .iprm { color: #FB923C; }
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-label {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: 500;
}

.toggle-label.inactive {
    color: var(--text-tertiary);
}

/* Slider/Range Input */
.slider-container {
    padding: 8px 0;
}

.form-range {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #e0e0e0, #bdbdbd);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    border: 1px solid #ccc;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 9px;
    margin-top: -2px;
}

.slider-ticks span {
    width: 2px;
    height: 8px;
    background: #999;
    border-radius: 1px;
}

/* Custom tick positioning when default is at 33% (left-biased) */
.slider-ticks.default-33 {
    position: relative;
    justify-content: flex-start;
    height: 8px;
}

.slider-ticks.default-33 span {
    position: absolute;
}

.slider-ticks.default-33 span:nth-child(1) {
    left: 9px;
}

.slider-ticks.default-33 span:nth-child(2) {
    left: 33.33%;
}

.slider-ticks.default-33 span:nth-child(3) {
    right: 9px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Custom label positioning when default is at 33% */
.slider-labels.default-33 {
    position: relative;
    min-height: 16px;
}

.slider-labels.default-33 span:nth-child(2) {
    position: absolute;
    left: 33.33%;
    transform: translateX(-50%);
}
