/**
 * Bacalli Influencer Portal Styles
 */

/* Reset and Base Styles */
.bip-dashboard * {
    box-sizing: border-box;
}

.bip-dashboard-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8fafc;
    color: #2d3748;
    line-height: 1.6;
}

/* Header */
.bip-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.bip-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bip-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.bip-user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bip-welcome {
    font-size: 0.9rem;
    opacity: 0.9;
}

.bip-logout {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 5px;
    transition: all 0.3s;
}

.bip-logout:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
    color: white;
}

/* Container */
.bip-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Stats Grid */
.bip-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.bip-stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.bip-stat-icon {
    font-size: 2rem;
    margin-right: 1rem;
    width: 50px;
    text-align: center;
}

.bip-stat-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
}

.bip-stat-info p {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
}

/* Dashboard Content */
.bip-dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.bip-main-column, .bip-sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Cards */
.bip-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.bip-card h2 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

/* Tables */
.bip-table-responsive {
    overflow-x: auto;
}

.bip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.bip-table th,
.bip-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.bip-table th {
    font-weight: 600;
    color: #4a5568;
    background-color: #f7fafc;
}

.bip-table tbody tr:hover {
    background-color: #f7fafc;
}

/* Status Badges */
.bip-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.bip-status-pending {
    background: #fed7d7;
    color: #c53030;
}

.bip-status-approved {
    background: #bee3f8;
    color: #2b6cb0;
}

.bip-status-paid {
    background: #c6f6d5;
    color: #2f855a;
}

.bip-status-cancelled {
    background: #fed7d7;
    color: #c53030;
}

/* Referral Codes */
.bip-referral-code {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.bip-referral-code:last-child {
    margin-bottom: 0;
}

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

.bip-code-header strong {
    font-size: 1.1rem;
    color: #2d3748;
}

.bip-code-stats {
    font-size: 0.8rem;
    color: #718096;
}

.bip-code-urls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bip-url-group label {
    display: block;
    font-size: 0.8rem;
    color: #4a5568;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.bip-url-copy {
    display: flex;
    gap: 0.5rem;
}

.bip-copy-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d2d6dc;
    border-radius: 5px;
    font-size: 0.8rem;
    background: white;
}

.bip-copy-btn {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.3s;
}

.bip-copy-btn:hover {
    background: #5a67d8;
}

/* Performance Items */
.bip-performance-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.bip-performance-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.bip-performance-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #2d3748;
}

.bip-conversion-rate {
    font-size: 0.8rem;
    color: #718096;
}

.bip-performance-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.bip-performance-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
    border-radius: 2px;
    transition: width 0.3s;
}

/* Traffic Sources */
.bip-traffic-source {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.bip-traffic-source:last-child {
    border-bottom: none;
}

.bip-source-name {
    font-weight: 500;
    color: #2d3748;
}

.bip-source-stats {
    font-size: 0.8rem;
    color: #718096;
}

/* Live Indicator */
.bip-live-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
}

.bip-live-indicator.active {
    display: flex;
}

.bip-pulse {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* No Data State */
.bip-no-data {
    text-align: center;
    color: #718096;
    padding: 2rem;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 968px) {
    .bip-dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .bip-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .bip-stat-card {
        padding: 1rem;
    }
    
    .bip-stat-icon {
        font-size: 1.5rem;
        width: 40px;
    }
    
    .bip-stat-info h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 640px) {
    .bip-container {
        padding: 0 0.75rem;
    }
    
    .bip-header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .bip-stats-grid {
        grid-template-columns: 1fr;
        margin: 1rem 0;
    }
    
    .bip-card {
        padding: 1rem;
    }
    
    .bip-url-copy {
        flex-direction: column;
    }
    
    .bip-copy-input {
        margin-bottom: 0.5rem;
    }
    
    .bip-table-responsive {
        font-size: 0.8rem;
    }
    
    .bip-table th,
    .bip-table td {
        padding: 0.5rem;
    }
}

/* Chart Container */
#bip-performance-chart {
    width: 100%;
    height: 200px;
    max-width: 100%;
}

/* Utilities */
.bip-text-center {
    text-align: center;
}

.bip-text-right {
    text-align: right;
}

.bip-mb-0 {
    margin-bottom: 0;
}

.bip-mt-0 {
    margin-top: 0;
}

.bip-hidden {
    display: none;
}