/* ============================================
   XDME AI - Dashboard Styles
   ============================================ */

.dashboard-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    font-size: 18px;
}

.sidebar-header .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-gradient-soft);
    color: var(--accent-primary);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-link .badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--accent-gradient);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 100px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 10px 16px;
    width: 320px;
}

.header-search i {
    color: var(--text-muted);
    font-size: 14px;
}

.header-search input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    width: 100%;
    font-family: inherit;
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.header-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-plan {
    font-size: 12px;
    color: var(--accent-primary);
}

/* Dashboard Content */
.dashboard-content {
    padding: 32px;
}

/* Welcome Banner */
.welcome-banner {
    background: var(--accent-gradient);
    border-radius: var(--radius-xl);
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.welcome-text {
    position: relative;
    z-index: 1;
}

.welcome-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-text p {
    opacity: 0.9;
    font-size: 15px;
}

.welcome-actions {
    position: relative;
    z-index: 1;
}

.welcome-actions .btn {
    background: white;
    color: var(--bg-primary);
    font-weight: 700;
}

/* Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon.green {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.card-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.card-link:hover {
    text-decoration: underline;
}

.card-header .badge {
    padding: 4px 10px;
    background: var(--success);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 100px;
}

.card-header .badge.live {
    animation: pulse 2s infinite;
}

/* Application List */
.application-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.application-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.application-item:hover {
    background: var(--bg-elevated);
}

.app-company {
    display: flex;
    align-items: center;
    gap: 12px;
}

.company-logo {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
}

.company-info {
    display: flex;
    flex-direction: column;
}

.company-name {
    font-weight: 600;
    font-size: 15px;
}

.company-role {
    font-size: 13px;
    color: var(--text-muted);
}

.app-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.applied {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.status-badge.interview {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.status-badge.screening {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-badge.offer {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.app-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* Auto Apply Widget */
.auto-apply-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.progress-ring {
    position: relative;
    width: 140px;
    height: 140px;
}

.progress-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-bg {
    fill: none;
    stroke: var(--bg-elevated);
    stroke-width: 8;
}

.progress-fill {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.progress-label {
    font-size: 12px;
    color: var(--text-muted);
}

.auto-apply-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.info-row strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.tool-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent-primary);
    margin: 0 auto 16px;
}

.tool-card h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tool-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* SVG Gradient Definition */
svg defs {
    display: none;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .dashboard-main {
        margin-left: 0;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .header-search {
        display: none;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
}
