/* ProduceData Export Intelligence - Professional Enterprise Theme */

/* CSS Variables - Enterprise Color Palette */
:root {
    --pd-primary: #0F766E;
    --pd-primary-dark: #0D5D56;
    --pd-primary-light: #14B8A6;
    --pd-accent: #0EA5E9;
    --pd-secondary: #1E293B;
    --pd-dark: #0F172A;
    --pd-success: #059669;
    --pd-warning: #D97706;
    --pd-danger: #DC2626;
    
    --pd-gray-50: #F8FAFC;
    --pd-gray-100: #F1F5F9;
    --pd-gray-200: #E2E8F0;
    --pd-gray-300: #CBD5E1;
    --pd-gray-400: #94A3B8;
    --pd-gray-500: #64748B;
    --pd-gray-600: #475569;
    --pd-gray-700: #334155;
    --pd-gray-800: #1E293B;
    --pd-gray-900: #0F172A;
    
    --pd-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --pd-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --pd-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --pd-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --pd-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    --pd-radius-sm: 6px;
    --pd-radius: 8px;
    --pd-radius-lg: 12px;
    --pd-radius-xl: 16px;
}

/* Reset & Base */
#producedata-full-app *,
#producedata-dashboard *,
#producedata-selector * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#producedata-full-app,
#producedata-dashboard {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, var(--pd-gray-50) 0%, var(--pd-gray-100) 100%);
    min-height: 100vh;
    color: var(--pd-gray-800);
    line-height: 1.6;
}

/* =====================================================
   HERO SECTION - Product & Market Selector
   ===================================================== */
.pd-hero {
    background: linear-gradient(135deg, var(--pd-dark) 0%, var(--pd-secondary) 50%, var(--pd-primary-dark) 100%);
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

.pd-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.pd-hero-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

.pd-hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
}

.pd-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pd-brand-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--pd-primary-light) 0%, var(--pd-primary) 100%);
    border-radius: var(--pd-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.4);
}

.pd-brand-logo svg {
    width: 32px;
    height: 32px;
    color: white;
}

.pd-brand-text h1 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.pd-brand-text span {
    font-size: 13px;
    color: var(--pd-gray-400);
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pd-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 100px;
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.pd-hero-badge svg {
    width: 16px;
    height: 16px;
    color: var(--pd-primary-light);
}

/* Selector Cards Container */
.pd-selector-section {
    margin-bottom: 32px;
}

.pd-selector-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.pd-selector-subtitle {
    color: var(--pd-gray-400);
    font-size: 16px;
    margin-bottom: 32px;
}

.pd-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Selector Card - Professional Style */
.pd-selector-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--pd-radius-xl);
    padding: 32px;
    transition: all 0.3s ease;
}

.pd-selector-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.pd-selector-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.pd-selector-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--pd-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-selector-icon.fruit {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.pd-selector-icon.market {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.pd-selector-icon svg {
    width: 26px;
    height: 26px;
    color: white;
}

.pd-selector-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--pd-gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.pd-selector-current {
    font-size: 20px;
    font-weight: 600;
    color: white;
}

/* Custom Select Dropdown */
.pd-select-wrapper {
    position: relative;
}

.pd-select {
    width: 100%;
    padding: 16px 48px 16px 20px;
    font-size: 16px;
    font-weight: 500;
    color: white;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--pd-radius-lg);
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pd-select:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.pd-select:focus {
    outline: none;
    border-color: var(--pd-primary-light);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2);
}

.pd-select option {
    background: var(--pd-gray-800);
    color: white;
    padding: 12px;
}

.pd-select-arrow {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--pd-gray-400);
}

.pd-select-arrow svg {
    width: 20px;
    height: 20px;
}

/* Action Buttons */
.pd-hero-actions {
    display: flex;
    gap: 16px;
    margin-top: 40px;
}

.pd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--pd-radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pd-btn-primary {
    background: linear-gradient(135deg, var(--pd-primary-light) 0%, var(--pd-primary) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.4);
}

.pd-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
}

.pd-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.pd-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.pd-btn svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   MAIN CONTENT AREA
   ===================================================== */
.pd-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
}

/* Stats Grid */
.pd-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.pd-stat-card {
    background: white;
    border-radius: var(--pd-radius-xl);
    padding: 28px;
    box-shadow: var(--pd-shadow);
    border: 1px solid var(--pd-gray-200);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pd-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--pd-primary-light), var(--pd-primary));
}

.pd-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--pd-shadow-lg);
}

.pd-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

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

.pd-stat-icon.green {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: var(--pd-success);
}

.pd-stat-icon.blue {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    color: var(--pd-accent);
}

.pd-stat-icon.purple {
    background: linear-gradient(135deg, #EDE9FE 0%, #DDD6FE 100%);
    color: #7C3AED;
}

.pd-stat-icon.orange {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: var(--pd-warning);
}

.pd-stat-icon svg {
    width: 24px;
    height: 24px;
}

.pd-stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
}

.pd-stat-trend.up {
    background: #D1FAE5;
    color: #059669;
}

.pd-stat-trend.down {
    background: #FEE2E2;
    color: #DC2626;
}

.pd-stat-trend svg {
    width: 14px;
    height: 14px;
}

.pd-stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--pd-gray-900);
    margin-bottom: 4px;
    letter-spacing: -1px;
}

.pd-stat-label {
    font-size: 14px;
    color: var(--pd-gray-500);
    font-weight: 500;
}

/* Content Cards */
.pd-card {
    background: white;
    border-radius: var(--pd-radius-xl);
    box-shadow: var(--pd-shadow);
    border: 1px solid var(--pd-gray-200);
    overflow: hidden;
}

.pd-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--pd-gray-100);
}

.pd-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--pd-gray-900);
    display: flex;
    align-items: center;
    gap: 12px;
}

.pd-card-title svg {
    width: 22px;
    height: 22px;
    color: var(--pd-primary);
}

.pd-card-body {
    padding: 28px;
}

/* Table Styles */
.pd-table {
    width: 100%;
    border-collapse: collapse;
}

.pd-table thead {
    background: var(--pd-gray-50);
}

.pd-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--pd-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--pd-gray-200);
}

.pd-table td {
    padding: 18px 20px;
    font-size: 14px;
    color: var(--pd-gray-700);
    border-bottom: 1px solid var(--pd-gray-100);
}

.pd-table tbody tr {
    transition: background 0.15s ease;
}

.pd-table tbody tr:hover {
    background: var(--pd-gray-50);
}

.pd-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.pd-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.pd-badge-success {
    background: #D1FAE5;
    color: #059669;
}

.pd-badge-warning {
    background: #FEF3C7;
    color: #D97706;
}

.pd-badge-info {
    background: #DBEAFE;
    color: #2563EB;
}

.pd-badge-neutral {
    background: var(--pd-gray-100);
    color: var(--pd-gray-600);
}

/* Loading State */
.pd-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
}

.pd-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--pd-gray-200);
    border-top-color: var(--pd-primary);
    border-radius: 50%;
    animation: pd-spin 0.8s linear infinite;
}

@keyframes pd-spin {
    to { transform: rotate(360deg); }
}

.pd-loading-text {
    margin-top: 20px;
    color: var(--pd-gray-500);
    font-size: 15px;
    font-weight: 500;
}

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

@media (max-width: 768px) {
    .pd-hero {
        padding: 40px 20px;
    }
    
    .pd-selector-grid {
        grid-template-columns: 1fr;
    }
    
    .pd-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .pd-hero-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .pd-hero-actions {
        flex-direction: column;
    }
    
    .pd-main {
        padding: 20px;
    }
}

/* Animations */
@keyframes pd-fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pd-animate {
    animation: pd-fade-up 0.5s ease-out forwards;
}

.pd-animate-delay-1 { animation-delay: 0.1s; }
.pd-animate-delay-2 { animation-delay: 0.2s; }
.pd-animate-delay-3 { animation-delay: 0.3s; }
.pd-animate-delay-4 { animation-delay: 0.4s; }
