/* =====================
   Portal Admin Dashboard Styles
   ===================== */

.cjpad-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Welcome Header (above hero) */
.cjpad-welcome-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: #fff;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e6e6e6;
}

.cjpad-profile-photo-standalone {
    flex-shrink: 0;
}

.cjpad-profile-photo-standalone img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #e6e6e6;
    object-fit: cover;
}

.cjpad-welcome-text {
    flex: 1;
}

.cjpad-welcome-text h1 {
    margin: 0 0 3px 0;
    font-size: 22px;
    font-weight: 700;
    color: #111;
}

.cjpad-welcome-text p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.cjpad-logout-btn {
    background: #f5f5f5;
    color: #111;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #e6e6e6;
    white-space: nowrap;
}

.cjpad-logout-btn:hover {
    background: #111;
    color: white;
    border-color: #111;
}

.cjpad-profile-btn {
    background: #fff;
    color: #111;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #e6e6e6;
    white-space: nowrap;
}

.cjpad-profile-btn:hover {
    background: #f5f5f5;
    border-color: #111;
}

/* Hero Section (compact stats banner) */
.cjpad-hero-section {
    background: linear-gradient(135deg, #111 0%, #2a2a2a 100%);
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-height: 150px;
}

.cjpad-hero-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.cjpad-hero-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 40px;
    min-height: 150px;
}

.cjpad-hero-stats {
    display: flex;
    gap: 60px;
    justify-content: center;
}

.cjpad-hero-stat {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cjpad-hero-stat-icon {
    font-size: 28px;
}

.cjpad-hero-stat-content {
    text-align: left;
}

.cjpad-hero-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: 5px;
}

.cjpad-hero-stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stats */
.cjpad-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.cjpad-stat-box {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
    border: 1px solid #e6e6e6;
    transition: all 0.2s;
}

.cjpad-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.cjpad-stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

.cjpad-stat-label {
    color: #666;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filters */
.cjpad-filters {
    background: white;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e6e6e6;
}

.cjpad-filter-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.cjpad-search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.cjpad-search-input:focus {
    outline: none;
    border-color: #111;
}

.cjpad-venue-select {
    padding: 12px 16px;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    font-size: 15px;
    min-width: 200px;
    transition: border-color 0.2s;
}

.cjpad-venue-select:focus {
    outline: none;
    border-color: #111;
}

.cjpad-filter-button {
    padding: 12px 24px;
    background: #111;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cjpad-filter-button:hover {
    background: #2a2a2a;
    transform: translateY(-1px);
}

.cjpad-clear-button {
    padding: 12px 24px;
    background: #f5f5f5;
    color: #111;
    border-radius: 10px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #e6e6e6;
}

.cjpad-clear-button:hover {
    background: #e6e6e6;
    color: #111;
    transform: translateY(-1px);
}

/* Events List */
.cjpad-events {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.cjpad-no-results {
    background: white;
    padding: 60px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cjpad-no-results h3 {
    margin: 0 0 10px 0;
    color: #666;
}

.cjpad-no-results p {
    margin: 0;
    color: #999;
}

/* Event Cards */
.cjpad-event-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.cjpad-event-card.upcoming {
    border-left: 5px solid #28a745;
}

.cjpad-event-card.past {
    border-left: 5px solid #6c757d;
}

.cjpad-event-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.cjpad-event-date {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.cjpad-event-venue {
    font-size: 16px;
    color: #666;
}

.cjpad-event-customer {
    padding: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.cjpad-event-customer h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: #111;
}

.cjpad-event-customer p {
    margin: 5px 0;
    color: #666;
    font-size: 15px;
}

/* Submissions */
.cjpad-submissions {
    padding: 25px;
}

.cjpad-submissions h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cjpad-no-submissions {
    padding: 30px;
    text-align: center;
    color: #999;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 4px;
}

.cjpad-submission-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cjpad-submission-wrapper {
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #111;
    overflow: hidden;
}

.cjpad-submission-item {
    display: grid;
    grid-template-columns: 40px 1fr auto auto auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    transition: background 0.2s;
}

.cjpad-submission-item:hover {
    background: #e9ecef;
}

.cjpad-submission-icon {
    font-size: 24px;
    text-align: center;
}

.cjpad-submission-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.cjpad-submission-date {
    color: #666;
    font-size: 14px;
}

.cjpad-submission-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cjpad-submission-status.status-completed {
    background: #d4edda;
    color: #155724;
}

.cjpad-submission-status.status-in_progress {
    background: #fff3cd;
    color: #856404;
}

.cjpad-submission-status.status-signed {
    background: #d1ecf1;
    color: #0c5460;
}

.cjpad-submission-status.status-pending {
    background: #fff3cd;
    color: #856404;
}

.cjpad-submission-actions {
    display: flex;
    gap: 8px;
}

.cjpad-action-btn {
    padding: 6px 12px;
    background: #111;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.cjpad-action-btn:hover {
    background: #2a2a2a;
    color: white;
    transform: translateY(-1px);
}

.cjpad-toggle-versions {
    background: #6c757d;
    font-size: 12px;
    padding: 4px 10px;
}

.cjpad-toggle-versions:hover {
    background: #5a6268;
}

.cjpad-no-pdf {
    color: #999;
    font-size: 13px;
    font-style: italic;
}

/* Older Versions */
.cjpad-older-versions {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #fff;
}

.cjpad-older-versions.open {
    max-height: 500px;
    padding: 10px 15px 10px 55px;
}

.cjpad-old-version-item {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
    margin-bottom: 5px;
    border-radius: 4px;
}

.cjpad-old-version-label {
    flex: 1;
    font-size: 14px;
    color: #666;
}

.cjpad-old-version-date {
    font-size: 12px;
    color: #999;
}

.cjpad-action-btn-small {
    padding: 4px 10px;
    background: #111;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.cjpad-action-btn-small:hover {
    background: #2a2a2a;
    color: white;
    transform: translateY(-1px);
}

/* Event Footer */
.cjpad-event-footer {
    padding: 15px 25px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.cjpad-view-event {
    color: #111;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
}

.cjpad-view-event:hover {
    color: #666;
}

/* Stats Bar */
.cjpad-stats-bar {
    display: flex;
    gap: 20px;
    padding: 15px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.cjpad-stat-item {
    display: flex;
    gap: 8px;
}

.cjpad-stat-label {
    font-weight: 600;
    color: #666;
}

.cjpad-stat-value {
    color: #111;
    font-weight: 700;
}

/* Timeline Section */
.cjpad-timeline-section {
    padding: 20px 25px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.cjpad-timeline-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.cjpad-timeline-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.cjpad-progress-bar {
    flex: 1;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.cjpad-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    transition: width 0.3s;
}

.cjpad-progress-text {
    font-weight: 600;
    color: #28a745;
    white-space: nowrap;
}

.cjpad-timeline-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cjpad-timeline-item {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cjpad-timeline-item.completed {
    background: #d4edda;
    color: #155724;
}

.cjpad-timeline-item.pending {
    background: #fff3cd;
    color: #856404;
}

.cjpad-due-date {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.8;
}

.cjpad-timeline-more {
    padding: 8px 12px;
    text-align: center;
    color: #666;
    font-style: italic;
    font-size: 13px;
}

/* Debug Section */
.cjpad-debug-section {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 2px solid #ffc107;
}

.cjpad-debug-section h4 {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 16px;
}

.cjpad-debug-content {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.cjpad-debug-content p {
    margin: 5px 0;
    color: #333;
}

.cjpad-debug-content strong {
    color: #0073aa;
}

.cjpad-debug-content details {
    margin: 10px 0;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cjpad-debug-content summary {
    cursor: pointer;
    font-weight: 600;
    color: #0073aa;
    user-select: none;
}

.cjpad-debug-content summary:hover {
    color: #005177;
}

.cjpad-debug-content pre {
    margin: 10px 0 0 0;
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 11px;
    max-height: 300px;
    overflow-y: auto;
}

/* Categorized Submissions */
.cjpad-submission-category {
    margin-bottom: 2rem;
}

.cjpad-submission-category:last-child {
    margin-bottom: 0;
}

.cjpad-submission-category h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e6e6e6;
}

/* Customer Breakdown Panel */
.cjpad-customer-breakdown {
    background: #f8f9fa;
    border: 2px solid #e6e6e6;
    border-radius: 12px;
    padding: 25px;
    margin: 0 25px 25px 25px;
}

.cjpad-customer-breakdown h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.cjpad-progress-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.cjpad-progress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    background: white;
    padding: 20px 15px;
    border-radius: 12px;
    border: 2px solid #e6e6e6;
    transition: all 0.2s;
    min-height: 140px;
    justify-content: space-between;
}

.cjpad-progress-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cjpad-progress-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.cjpad-progress-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
}

.cjpad-progress-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    width: 100%;
}

.cjpad-badge-completed {
    background: #d1fae5;
    color: #065f46;
}

.cjpad-badge-in-progress {
    background: #fed7aa;
    color: #92400e;
}

.cjpad-badge-not-started {
    background: #f3f4f6;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
    /* Welcome header responsive */
    .cjpad-welcome-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .cjpad-welcome-text h1 {
        font-size: 24px;
    }
    
    .cjpad-logout-btn {
        width: 100%;
        text-align: center;
    }
    
    /* Hero responsive */
    .cjpad-hero-content {
        padding: 20px;
    }
    
    .cjpad-hero-stats {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .cjpad-hero-stat {
        justify-content: center;
    }
    
    /* Breakdown responsive */
    .cjpad-progress-list {
        grid-template-columns: 1fr;
    }
    
    .cjpad-customer-breakdown {
        margin: 0 15px 15px 15px;
        padding: 20px;
    }
    
    .cjpad-filter-form {
        flex-direction: column;
    }
    
    .cjpad-search-input,
    .cjpad-venue-select {
        width: 100%;
    }
    
    .cjpad-submission-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cjpad-submission-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .cjpad-event-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .cjpad-stats-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .cjpad-timeline-progress {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Print styles */
@media print {
    .cjpad-header,
    .cjpad-filters,
    .cjpad-logout,
    .cjpad-action-btn,
    .cjpad-event-footer,
    .cjpad-debug-section {
        display: none;
    }
    
    .cjpad-event-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }
}
