.mmn-market-tracker {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mmn-widget {
    display: flex;
    flex-direction: column;
}

.mmn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-wrap: wrap;
    gap: 1rem;
}

.mmn-header-left {
    flex: 1;
    min-width: 250px;
}

.mmn-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mmn-icon {
    width: 28px;
    height: 28px;
}

.mmn-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mmn-zip-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.95rem;
    width: 120px;
    transition: all 0.2s;
}

.mmn-zip-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.mmn-zip-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.mmn-commodity-select {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.95rem;
    min-width: 150px;
}

.mmn-commodity-select option {
    background: #667eea;
    color: white;
}

.mmn-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmn-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.mmn-btn:active {
    transform: scale(0.95);
}

.mmn-refresh-btn.mmn-spinning svg {
    animation: mmn-spin 1s linear infinite;
}

@keyframes mmn-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mmn-menu {
    position: relative;
}

.mmn-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.mmn-menu-dropdown.mmn-show {
    display: block;
}

.mmn-menu-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    color: #333;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.mmn-menu-item:hover {
    background: #f5f5f5;
}

.mmn-status-bar {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    display: none;
}

.mmn-status-info {
    background: #e3f2fd;
    color: #1976d2;
    border-bottom: 1px solid #90caf9;
}

.mmn-status-warning {
    background: #fff3e0;
    color: #f57c00;
    border-bottom: 1px solid #ffb74d;
}

.mmn-status-error {
    background: #ffebee;
    color: #c62828;
    border-bottom: 1px solid #ef5350;
}

.mmn-main {
    padding: 1.5rem;
}

.mmn-price-table-container {
    overflow-x: auto;
}

.mmn-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.mmn-price-table thead {
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}

.mmn-price-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.mmn-price-table tbody tr.mmn-price-row {
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.2s;
}

.mmn-price-table tbody tr.mmn-price-row:hover {
    background: #fafafa;
}

.mmn-price-table td {
    padding: 1rem;
}

.mmn-commodity-cell {
    font-weight: 500;
    color: #333;
}

.mmn-expand-icon {
    display: inline-block;
    margin-right: 0.5rem;
    color: #667eea;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.mmn-details-row {
    background: #fafafa;
}

.mmn-details-content {
    padding: 1rem;
    max-height: 400px;
    overflow: auto;
}

.mmn-details-content pre {
    margin: 0;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.85rem;
    overflow-x: auto;
}

.mmn-btn-small {
    padding: 0.4rem 0.8rem;
    border: 1px solid #667eea;
    border-radius: 4px;
    background: white;
    color: #667eea;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.mmn-btn-small:hover {
    background: #667eea;
    color: white;
}

.mmn-no-data td {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-style: italic;
}

.mmn-footer {
    padding: 1rem 1.5rem;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.mmn-attribution {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.mmn-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #666;
}

.mmn-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: mmn-spin 1s linear infinite;
    margin-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
    .mmn-market-tracker {
        background: #1a1a1a;
        border-color: #333;
        color: #e0e0e0;
    }
    
    .mmn-price-table thead {
        background: #2a2a2a;
        border-bottom-color: #444;
    }
    
    .mmn-price-table th {
        color: #aaa;
    }
    
    .mmn-price-table tbody tr.mmn-price-row {
        border-bottom-color: #333;
    }
    
    .mmn-price-table tbody tr.mmn-price-row:hover {
        background: #252525;
    }
    
    .mmn-details-row {
        background: #252525;
    }
    
    .mmn-details-content pre {
        background: #1a1a1a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .mmn-footer {
        background: #2a2a2a;
        border-top-color: #444;
    }
    
    .mmn-menu-dropdown {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .mmn-menu-item {
        color: #e0e0e0;
    }
    
    .mmn-menu-item:hover {
        background: #333;
    }
    
    .mmn-commodity-cell {
        color: #e0e0e0;
    }
}

@media (max-width: 768px) {
    .mmn-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mmn-header-right {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mmn-zip-input,
    .mmn-commodity-select {
        width: 100%;
    }
    
    .mmn-title {
        font-size: 1.2rem;
    }
    
    .mmn-price-table {
        font-size: 0.85rem;
    }
    
    .mmn-price-table th,
    .mmn-price-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .mmn-price-table th:nth-child(4),
    .mmn-price-table td:nth-child(4),
    .mmn-price-table th:nth-child(5),
    .mmn-price-table td:nth-child(5) {
        display: none;
    }
}
