/**
 * Frontend Styles
 * Professional marketplace project manager frontend styles
 */

/* Main Container */
.mpm-frontend-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 24px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 2px;
}

.mpm-wrapper {
    background: white;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Header */
.mpm-header {
    text-align: center;
    margin-bottom: 32px;
}

.mpm-header h2 {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.mpm-header p {
    color: #6b7280;
    font-size: 16px;
    margin: 0;
}

/* Filters Section */
.mpm-filters {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.mpm-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    border-radius: 16px 16px 0 0;
}

.mpm-filter-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mpm-filter-title::before {
    content: '🔍';
    font-size: 20px;
}

.mpm-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.mpm-filter-group {
    position: relative;
}

.mpm-filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mpm-filter-group select,
.mpm-filter-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mpm-filter-group select:focus,
.mpm-filter-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Loading State */
.mpm-loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.mpm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: mpm-spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes mpm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Info */
.mpm-results-info {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 1px solid #bae6fd;
}

.mpm-results-count {
    font-weight: 600;
    color: #0369a1;
}

.mpm-results-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.mpm-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mpm-stat-label {
    color: #6b7280;
}

.mpm-stat-value {
    font-weight: 600;
    color: #059669;
}

/* Table Section */
.mpm-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    position: relative;
}

.mpm-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

.mpm-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.mpm-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 700;
    color: #1f2937;
    border-bottom: 2px solid #e5e7eb;
    font-size: 13px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 10;
}

.mpm-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    vertical-align: middle;
    transition: background-color 0.2s ease;
}

.mpm-table tbody tr {
    transition: all 0.2s ease;
}

.mpm-table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: scale(1.01);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mpm-amount {
    font-weight: 700;
    color: #059669;
    font-size: 15px;
}

.mpm-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mpm-status-wip { 
    background: linear-gradient(135deg, #fef3c7, #fed7aa); 
    color: #92400e; 
}

.mpm-status-revision { 
    background: linear-gradient(135deg, #fee2e2, #fecaca); 
    color: #991b1b; 
}

.mpm-status-delivered { 
    background: linear-gradient(135deg, #dbeafe, #bfdbfe); 
    color: #1d4ed8; 
}

.mpm-status-completed { 
    background: linear-gradient(135deg, #d1fae5, #a7f3d0); 
    color: #065f46; 
}

.mpm-status-canceled { 
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb); 
    color: #6b7280; 
}

.mpm-status-tips { 
    background: linear-gradient(135deg, #ede9fe, #ddd6fe); 
    color: #5b21b6; 
}

.mpm-status-compensation { 
    background: linear-gradient(135deg, #fce7f3, #fbcfe8); 
    color: #9d174d; 
}

.mpm-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mpm-link:hover {
    background: #eff6ff;
    color: #2563eb;
    transform: translateY(-1px);
}

.mpm-no-data {
    text-align: center;
    padding: 60px;
    color: #6b7280;
    font-size: 18px;
    font-weight: 500;
}

.mpm-no-data::before {
    content: '📭';
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
}

/* Summary Row */
.mpm-summary-row {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    font-weight: 700;
}

.mpm-summary-row td {
    border-bottom: none;
    padding: 16px 12px;
}

.mpm-summary-label {
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mpm-summary-total {
    color: #10b981;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Charts Section */
.mpm-charts-section {
    margin: 32px 0;
}

.mpm-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.mpm-chart-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.mpm-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mpm-chart-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.mpm-chart-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
}

.mpm-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mpm-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.mpm-chart-wrapper {
    position: relative;
    height: 200px;
}

/* Stats Cards */
.mpm-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.mpm-stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    text-align: center;
    transition: all 0.3s ease;
}

.mpm-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mpm-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 5px;
}

.mpm-stat-label {
    font-size: 14px;
    color: #6b7280;
}

.mpm-amount {
    color: #059669;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mpm-wrapper {
        padding: 16px;
    }
    
    .mpm-header h2 {
        font-size: 24px;
    }
    
    .mpm-filter-grid {
        grid-template-columns: 1fr;
    }
    
    .mpm-table {
        font-size: 12px;
    }
    
    .mpm-table th, 
    .mpm-table td {
        padding: 10px 6px;
    }
    
    .mpm-results-info {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .mpm-results-stats {
        justify-content: center;
    }
    
    .mpm-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .mpm-chart-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .mpm-stats-container {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes mpm-fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.mpm-table tbody tr {
    animation: mpm-fadeIn 0.3s ease forwards;
}

.mpm-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.mpm-table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.mpm-table tbody tr:nth-child(3) { animation-delay: 0.3s; }
.mpm-table tbody tr:nth-child(4) { animation-delay: 0.4s; }
.mpm-table tbody tr:nth-child(5) { animation-delay: 0.5s; }

/* Print Styles */
@media print {
    .mpm-frontend-container {
        background: white;
        box-shadow: none;
    }
    
    .mpm-filters {
        display: none;
    }
    
    .mpm-loading {
        display: none;
    }
    
    .mpm-table {
        font-size: 12px;
    }
    
    .mpm-chart-container {
        page-break-inside: avoid;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mpm-wrapper {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .mpm-header h2 {
        background: linear-gradient(135deg, #60a5fa, #a78bfa);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .mpm-filters {
        background: linear-gradient(135deg, #374151, #4b5563);
        border-color: #4b5563;
    }
    
    .mpm-filter-group label {
        color: #d1d5db;
    }
    
    .mpm-table-wrapper {
        background: #374151;
        border-color: #4b5563;
    }
    
    .mpm-table th {
        background: #4b5563;
        color: #f9fafb;
    }
    
    .mpm-table td {
        border-color: #6b7280;
    }
    
    .mpm-table tbody tr:hover {
        background: #4b5563;
    }
}

/* Accessibility */
.mpm-table th:focus,
.mpm-table td:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

.mpm-filter-group select:focus,
.mpm-filter-group input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .mpm-frontend-container {
        background: #000;
        border: 2px solid #fff;
    }
    
    .mpm-wrapper {
        background: #fff;
        color: #000;
    }
    
    .mpm-table th {
        background: #000;
        color: #fff;
    }
    
    .mpm-table tbody tr:nth-child(even) {
        background: #f0f0f0;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .mpm-table tbody tr,
    .mpm-stat-card,
    .mpm-filter-group select,
    .pm-filter-group input {
        animation: none;
        transition: none;
    }
}
