/**
 * Maritime Job Market Widget Styles
 * Professional, modern, compact design
 */

/* Import Nunito Sans font */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700;800&display=swap');

.maritime-widget {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 867px;  /* 85% of 1020px */
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Header */
.widget-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: #ffffff;
    padding: 12px 20px;  /* 85% of 14px = 12px */
    text-align: center;
}

.widget-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Stats Row - 2 cards side by side */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid #e1e8ed;
}

.stat-card {
    padding: 12px;  /* 85% of 14px = 12px */
    text-align: center;
    border-right: 1px solid #e1e8ed;
}

.stat-card:last-child {
    border-right: none;
}

.stat-value {
    font-size: 2.55rem;
    font-weight: 800;
    color: #1e3a5f;
    line-height: 1;
    margin-bottom: 5px;  /* 85% of 6px = 5px */
}

.stat-label {
    font-size: 0.875rem;
    color: #5a6c7d;
    font-weight: 600;
    line-height: 1.3;
}

/* Content Grid - 3 columns: 40%, 30%, 30% */
.content-grid {
    display: grid;
    grid-template-columns: 40% 30% 30%;  /* Custom distribution */
    gap: 0;
    border-bottom: 1px solid #e1e8ed;
}

.content-card {
    padding: 10px;  /* 85% of 12px = 10px */
    border-right: 1px solid #e1e8ed;
}

.content-card:last-child {
    border-right: none;
}

.card-title {
    margin: 0 0 8px 0;  /* 85% of 10px = 8px */
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e3a5f;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 7px;  /* 85% of 8px = 7px */
    border-bottom: 2px solid #e1e8ed;
    text-align: center;
}

/* Item Lists */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 4px;  /* 85% of 5px = 4px */
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 2px 0;  /* 85% of 3px = 2.5px, rounded to 2px */
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
}

.item-detail {
    font-size: 0.75rem;
    color: #5a6c7d;
    font-weight: 400;
}

.item-count {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1e3a5f;
    background: #e6f2ff;
    padding: 3px 7px;
    border-radius: 10px;
    white-space: nowrap;
    align-self: center;
}

.no-data {
    text-align: center;
    color: #8695a6;
    font-style: italic;
    font-size: 0.875rem;
    padding: 12px 0;
    margin: 0;
}

/* Footer */
.widget-footer {
    background: #f7fafc;
    padding: 7px 20px;  /* 85% of 8px = 7px */
    text-align: center;
}

.widget-footer p {
    margin: 0;
    font-size: 0.64rem;
    color: #5a6c7d;
    font-weight: 500;
}

/* Loading State */
.widget-loading {
    text-align: center;
    padding: 60px 24px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e1e8ed;
    border-top-color: #1e3a5f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.widget-loading p {
    color: #5a6c7d;
    font-size: 0.9375rem;
    margin: 0;
}

/* Error State */
.widget-error {
    text-align: center;
    padding: 40px 24px;
    background: #fef3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    margin: 20px;
}

.widget-error p {
    margin: 0 0 8px 0;
    color: #856404;
    font-size: 0.9375rem;
}

.widget-error p:last-child {
    margin-bottom: 0;
}

.error-detail {
    font-size: 0.8125rem !important;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .content-card {
        border-right: none;
        border-bottom: 1px solid #e1e8ed;
    }
    
    .content-card:last-child {
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    .widget-title {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 2.25rem;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        border-right: none;
        border-bottom: 1px solid #e1e8ed;
    }
    
    .stat-card:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .maritime-widget {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .widget-header {
        padding: 16px 20px;
    }
    
    .widget-title {
        font-size: 1.125rem;
    }
    
    .stat-card,
    .content-card,
    .widget-footer {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.8125rem;
    }
    
    .item-name {
        font-size: 0.8125rem;
    }
    
    .item-count {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
}

/* Print Styles */
@media print {
    .maritime-widget {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .widget-header {
        background: #1e3a5f;
        color: #ffffff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
