/* Dashboard Specific Styles */

.dashboard {
    background-color: #f8fafc;
    min-height: 100vh;
    padding-top: 80px;
}

.dashboard .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.site-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.site-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ef4444;
}

.status-indicator.active {
    background-color: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-range {
    display: flex;
    background: white;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.time-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.time-btn:hover {
    background-color: #f1f5f9;
    color: #334155;
}

.time-btn.active {
    background-color: #5850ec;
    color: white;
}

.btn-share {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-share:hover {
    border-color: #5850ec;
    color: #5850ec;
}

/* Real-time Section */
.realtime-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 1rem;
}

.realtime-counter {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.counter-number {
    font-size: 3rem;
    font-weight: 700;
    color: #10b981;
    line-height: 1;
}

.counter-label {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.card-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1;
}

.change {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.change.positive {
    color: #10b981;
    background-color: #d1fae5;
}

.change.negative {
    color: #ef4444;
    background-color: #fee2e2;
}

.chart-container {
    height: 200px;
    margin-top: 1rem;
}

.metric-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    font-size: 0.875rem;
    color: #64748b;
}

.metric-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a202c;
}

/* Duration Breakdown */
.duration-breakdown {
    margin-top: 1rem;
}

.duration-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f1f5f9;
}

.duration-segment {
    height: 100%;
    transition: all 0.3s;
}

.duration-segment:nth-child(1) { background-color: #ef4444; }
.duration-segment:nth-child(2) { background-color: #f59e0b; }
.duration-segment:nth-child(3) { background-color: #10b981; }
.duration-segment:nth-child(4) { background-color: #3b82f6; }

/* Sources Section */
.sources-section {
    margin-bottom: 2rem;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.source-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.source-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 1rem 0;
}

.source-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.source-item:hover {
    background-color: #f8fafc;
}

.source-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.source-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a202c;
}

.source-url {
    font-size: 0.75rem;
    color: #64748b;
}

.source-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.source-visitors {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a202c;
}

.source-percentage {
    font-size: 0.75rem;
    color: #64748b;
}

/* Goals Section */
.goals-section {
    margin-bottom: 2rem;
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.goal-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.goal-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.goal-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.goal-type {
    font-size: 0.75rem;
    color: #64748b;
    background-color: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.goal-stats {
    display: flex;
    gap: 2rem;
}

.goal-metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.goal-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #5850ec;
    line-height: 1;
}

.goal-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #dc2626;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard .container {
        padding: 1rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .dashboard-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sources-grid {
        grid-template-columns: 1fr;
    }
    
    .goals-grid {
        grid-template-columns: 1fr;
    }
    
    .goal-stats {
        gap: 1rem;
    }
    
    .time-range {
        flex: 1;
    }
    
    .time-btn {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.5rem;
    }
    
    .counter-number {
        font-size: 2rem;
    }
    
    .main-number {
        font-size: 1.5rem;
    }
    
    .source-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .source-stats {
        align-items: flex-start;
    }
}